| 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 pending_events_.push_back(std::move(pending_event)); | 709 pending_events_.push_back(std::move(pending_event)); |
| 710 } else { | 710 } else { |
| 711 if (event->IsKeyEvent()) | 711 if (event->IsKeyEvent()) |
| 712 delegate()->DispatchKeyEventToIME(current_target_, event->AsKeyEvent()); | 712 delegate()->DispatchKeyEventToIME(current_target_, event->AsKeyEvent()); |
| 713 MaybeDispatchToPointerWatchers(*event); | 713 MaybeDispatchToPointerWatchers(*event); |
| 714 if (!event->handled()) { | 714 if (!event->handled()) { |
| 715 ui::EventSource* event_source = | 715 ui::EventSource* event_source = |
| 716 delegate()->GetEventSource(current_target_); | 716 delegate()->GetEventSource(current_target_); |
| 717 ui::EventSourceTestApi event_source_test(event_source); | 717 ui::EventSourceTestApi event_source_test(event_source); |
| 718 ui::EventDispatchDetails details = | 718 ui::EventDispatchDetails details = |
| 719 event_source_test.SendEventToProcessor(event); | 719 event_source_test.SendEventToSink(event); |
| 720 CHECK(!details.dispatcher_destroyed); | 720 CHECK(!details.dispatcher_destroyed); |
| 721 } | 721 } |
| 722 } | 722 } |
| 723 } | 723 } |
| 724 | 724 |
| 725 void EventGenerator::MaybeDispatchToPointerWatchers(const Event& event) { | 725 void EventGenerator::MaybeDispatchToPointerWatchers(const Event& event) { |
| 726 // Regular pointer events can be dispatched directly. | 726 // Regular pointer events can be dispatched directly. |
| 727 if (event.IsPointerEvent()) { | 727 if (event.IsPointerEvent()) { |
| 728 delegate()->DispatchEventToPointerWatchers(current_target_, | 728 delegate()->DispatchEventToPointerWatchers(current_target_, |
| 729 *event.AsPointerEvent()); | 729 *event.AsPointerEvent()); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 return default_delegate; | 764 return default_delegate; |
| 765 } | 765 } |
| 766 | 766 |
| 767 EventGeneratorDelegate* EventGenerator::delegate() { | 767 EventGeneratorDelegate* EventGenerator::delegate() { |
| 768 return const_cast<EventGeneratorDelegate*>( | 768 return const_cast<EventGeneratorDelegate*>( |
| 769 const_cast<const EventGenerator*>(this)->delegate()); | 769 const_cast<const EventGenerator*>(this)->delegate()); |
| 770 } | 770 } |
| 771 | 771 |
| 772 } // namespace test | 772 } // namespace test |
| 773 } // namespace ui | 773 } // namespace ui |
| OLD | NEW |