OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/test/event_generator.h" | 5 #include "ui/events/test/event_generator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 if (async) { | 681 if (async) { |
682 std::unique_ptr<ui::Event> pending_event = ui::Event::Clone(*event); | 682 std::unique_ptr<ui::Event> pending_event = ui::Event::Clone(*event); |
683 if (pending_events_.empty()) { | 683 if (pending_events_.empty()) { |
684 base::ThreadTaskRunnerHandle::Get()->PostTask( | 684 base::ThreadTaskRunnerHandle::Get()->PostTask( |
685 FROM_HERE, | 685 FROM_HERE, |
686 base::Bind(&EventGenerator::DispatchNextPendingEvent, | 686 base::Bind(&EventGenerator::DispatchNextPendingEvent, |
687 base::Unretained(this))); | 687 base::Unretained(this))); |
688 } | 688 } |
689 pending_events_.push_back(std::move(pending_event)); | 689 pending_events_.push_back(std::move(pending_event)); |
690 } else { | 690 } else { |
| 691 if (event->IsKeyEvent()) |
| 692 delegate()->DispatchKeyEventToIME(current_target_, event->AsKeyEvent()); |
691 MaybeDispatchToPointerWatchers(*event); | 693 MaybeDispatchToPointerWatchers(*event); |
692 if (!event->handled()) { | 694 if (!event->handled()) { |
693 ui::EventSource* event_source = | 695 ui::EventSource* event_source = |
694 delegate()->GetEventSource(current_target_); | 696 delegate()->GetEventSource(current_target_); |
695 ui::EventSourceTestApi event_source_test(event_source); | 697 ui::EventSourceTestApi event_source_test(event_source); |
696 ui::EventDispatchDetails details = | 698 ui::EventDispatchDetails details = |
697 event_source_test.SendEventToSink(event); | 699 event_source_test.SendEventToSink(event); |
698 CHECK(!details.dispatcher_destroyed); | 700 CHECK(!details.dispatcher_destroyed); |
699 } | 701 } |
700 } | 702 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 return default_delegate; | 744 return default_delegate; |
743 } | 745 } |
744 | 746 |
745 EventGeneratorDelegate* EventGenerator::delegate() { | 747 EventGeneratorDelegate* EventGenerator::delegate() { |
746 return const_cast<EventGeneratorDelegate*>( | 748 return const_cast<EventGeneratorDelegate*>( |
747 const_cast<const EventGenerator*>(this)->delegate()); | 749 const_cast<const EventGenerator*>(this)->delegate()); |
748 } | 750 } |
749 | 751 |
750 } // namespace test | 752 } // namespace test |
751 } // namespace ui | 753 } // namespace ui |
OLD | NEW |