Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: ui/events/test/event_generator.cc

Issue 2712963003: mustash: Use ui::chromeos::EventRewriter in mus (Closed)
Patch Set: Fix build issues. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/event_source.cc ('k') | ui/events/test/events_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/events/event_source.cc ('k') | ui/events/test/events_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698