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

Unified Diff: ash/sticky_keys/sticky_keys_controller.cc

Issue 147203004: aura: Remove event-dispatch methods from WindowTreeHostDelegate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/drag_drop/drag_drop_controller_unittest.cc ('k') | ash/sticky_keys/sticky_keys_overlay_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/sticky_keys/sticky_keys_controller.cc
diff --git a/ash/sticky_keys/sticky_keys_controller.cc b/ash/sticky_keys/sticky_keys_controller.cc
index abb79067c4627ce61ca19a837c42806817bfa6e8..b65521284f0972de952c619214a8c4cb9612642c 100644
--- a/ash/sticky_keys/sticky_keys_controller.cc
+++ b/ash/sticky_keys/sticky_keys_controller.cc
@@ -47,6 +47,8 @@ class StickyKeysHandlerDelegateImpl :
virtual void DispatchScrollEvent(ui::ScrollEvent* event,
aura::Window* target) OVERRIDE;
private:
+ void DispatchEvent(ui::Event* event, aura::Window* target);
+
DISALLOW_COPY_AND_ASSIGN(StickyKeysHandlerDelegateImpl);
};
@@ -58,8 +60,7 @@ StickyKeysHandlerDelegateImpl::~StickyKeysHandlerDelegateImpl() {
void StickyKeysHandlerDelegateImpl::DispatchKeyEvent(ui::KeyEvent* event,
aura::Window* target) {
- DCHECK(target);
- target->GetDispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent(event);
+ DispatchEvent(event, target);
}
void StickyKeysHandlerDelegateImpl::DispatchMouseEvent(ui::MouseEvent* event,
@@ -68,21 +69,26 @@ void StickyKeysHandlerDelegateImpl::DispatchMouseEvent(ui::MouseEvent* event,
// We need to send a new, untransformed mouse event to the host.
if (event->IsMouseWheelEvent()) {
ui::MouseWheelEvent new_event(*static_cast<ui::MouseWheelEvent*>(event));
- target->GetDispatcher()->AsWindowTreeHostDelegate()
- ->OnHostMouseEvent(&new_event);
+ DispatchEvent(&new_event, target);
} else {
ui::MouseEvent new_event(*event, target, target->GetRootWindow());
- target->GetDispatcher()->AsWindowTreeHostDelegate()
- ->OnHostMouseEvent(&new_event);
+ DispatchEvent(&new_event, target);
}
}
void StickyKeysHandlerDelegateImpl::DispatchScrollEvent(
ui::ScrollEvent* event,
aura::Window* target) {
+ DispatchEvent(event, target);
+}
+
+void StickyKeysHandlerDelegateImpl::DispatchEvent(ui::Event* event,
+ aura::Window* target) {
DCHECK(target);
- target->GetDispatcher()->AsWindowTreeHostDelegate()
- ->OnHostScrollEvent(event);
+ ui::EventDispatchDetails details =
+ target->GetDispatcher()->OnEventFromSource(event);
+ if (details.dispatcher_destroyed)
+ return;
}
} // namespace
« no previous file with comments | « ash/drag_drop/drag_drop_controller_unittest.cc ('k') | ash/sticky_keys/sticky_keys_overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698