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

Side by Side Diff: ui/aura/window_event_dispatcher.h

Issue 2715743005: Revert of Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)
Patch Set: Created 3 years, 10 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/aura/test/test_window_targeter.cc ('k') | ui/aura/window_event_dispatcher.cc » ('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 #ifndef UI_AURA_WINDOW_EVENT_DISPATCHER_H_ 5 #ifndef UI_AURA_WINDOW_EVENT_DISPATCHER_H_
6 #define UI_AURA_WINDOW_EVENT_DISPATCHER_H_ 6 #define UI_AURA_WINDOW_EVENT_DISPATCHER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 public client::CaptureDelegate, 53 public client::CaptureDelegate,
54 public WindowObserver, 54 public WindowObserver,
55 public EnvObserver { 55 public EnvObserver {
56 public: 56 public:
57 explicit WindowEventDispatcher(WindowTreeHost* host); 57 explicit WindowEventDispatcher(WindowTreeHost* host);
58 ~WindowEventDispatcher() override; 58 ~WindowEventDispatcher() override;
59 59
60 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } 60 Window* mouse_pressed_handler() { return mouse_pressed_handler_; }
61 Window* mouse_moved_handler() { return mouse_moved_handler_; } 61 Window* mouse_moved_handler() { return mouse_moved_handler_; }
62 62
63 // Overridden from ui::EventProcessor:
64 ui::EventTargeter* GetDefaultEventTargeter() override;
65
66 // Repost event for re-processing. Used when exiting context menus. 63 // Repost event for re-processing. Used when exiting context menus.
67 // We support the ET_MOUSE_PRESSED, ET_TOUCH_PRESSED and ET_GESTURE_TAP_DOWN 64 // We support the ET_MOUSE_PRESSED, ET_TOUCH_PRESSED and ET_GESTURE_TAP_DOWN
68 // event types (although the latter is currently a no-op). 65 // event types (although the latter is currently a no-op).
69 void RepostEvent(const ui::LocatedEvent* event); 66 void RepostEvent(const ui::LocatedEvent* event);
70 67
71 // Invoked when the mouse events get enabled or disabled. 68 // Invoked when the mouse events get enabled or disabled.
72 void OnMouseEventsEnableStateChanged(bool enabled); 69 void OnMouseEventsEnableStateChanged(bool enabled);
73 70
74 void DispatchCancelModeEvent(); 71 void DispatchCancelModeEvent();
75 72
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 166
170 bool is_dispatched_held_event(const ui::Event& event) const; 167 bool is_dispatched_held_event(const ui::Event& event) const;
171 168
172 // Overridden from aura::client::CaptureDelegate: 169 // Overridden from aura::client::CaptureDelegate:
173 void UpdateCapture(Window* old_capture, Window* new_capture) override; 170 void UpdateCapture(Window* old_capture, Window* new_capture) override;
174 void OnOtherRootGotCapture() override; 171 void OnOtherRootGotCapture() override;
175 void SetNativeCapture() override; 172 void SetNativeCapture() override;
176 void ReleaseNativeCapture() override; 173 void ReleaseNativeCapture() override;
177 174
178 // Overridden from ui::EventProcessor: 175 // Overridden from ui::EventProcessor:
179 ui::EventTarget* GetRootForEvent(ui::Event* event) override; 176 ui::EventTarget* GetRootTarget() override;
180 void OnEventProcessingStarted(ui::Event* event) override; 177 void OnEventProcessingStarted(ui::Event* event) override;
181 void OnEventProcessingFinished(ui::Event* event) override; 178 void OnEventProcessingFinished(ui::Event* event) override;
182 179
183 // Overridden from ui::EventDispatcherDelegate. 180 // Overridden from ui::EventDispatcherDelegate.
184 bool CanDispatchToTarget(ui::EventTarget* target) override; 181 bool CanDispatchToTarget(ui::EventTarget* target) override;
185 ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, 182 ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target,
186 ui::Event* event) override; 183 ui::Event* event) override;
187 ui::EventDispatchDetails PostDispatchEvent(ui::EventTarget* target, 184 ui::EventDispatchDetails PostDispatchEvent(ui::EventTarget* target,
188 const ui::Event& event) override; 185 const ui::Event& event) override;
189 186
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 255
259 // Set when dispatching a held event. 256 // Set when dispatching a held event.
260 ui::LocatedEvent* dispatching_held_event_; 257 ui::LocatedEvent* dispatching_held_event_;
261 258
262 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; 259 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_;
263 260
264 std::unique_ptr<EnvInputStateController> env_controller_; 261 std::unique_ptr<EnvInputStateController> env_controller_;
265 262
266 std::unique_ptr<MusMouseLocationUpdater> mus_mouse_location_updater_; 263 std::unique_ptr<MusMouseLocationUpdater> mus_mouse_location_updater_;
267 264
268 // The default EventTargeter for WindowEventDispatcher generated events.
269 std::unique_ptr<ui::EventTargeter> event_targeter_;
270
271 // Used to schedule reposting an event. 265 // Used to schedule reposting an event.
272 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; 266 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_;
273 267
274 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. 268 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0.
275 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; 269 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_;
276 270
277 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); 271 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher);
278 }; 272 };
279 273
280 } // namespace aura 274 } // namespace aura
281 275
282 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ 276 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_
OLDNEW
« no previous file with comments | « ui/aura/test/test_window_targeter.cc ('k') | ui/aura/window_event_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698