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

Unified Diff: views/mouse_watcher.cc

Issue 8021009: Consolidate message observer API for win and aura (and touch). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 3 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
Index: views/mouse_watcher.cc
diff --git a/views/mouse_watcher.cc b/views/mouse_watcher.cc
index df5adeb4eecfa99829a1a01b9cf04397a515f0a9..5daab258058a301ce1fdf4c2232d9b0b51fbbb65 100644
--- a/views/mouse_watcher.cc
+++ b/views/mouse_watcher.cc
@@ -35,10 +35,12 @@ class MouseWatcher::Observer : public MessageLoopForUI::Observer {
// MessageLoop::Observer implementation:
#if defined(OS_WIN)
- void WillProcessMessage(const MSG& msg) OVERRIDE {
+ virtual base::EventStatus WillProcessEvent(
+ const base::NativeEvent& event) OVERRIDE {
+ return base::EVENT_CONTINUE;
}
- void DidProcessMessage(const MSG& msg) OVERRIDE {
+ virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE {
// We spy on three different Windows messages here to see if the mouse has
// moved out of the bounds of the view. The messages are:
//
@@ -50,7 +52,7 @@ class MouseWatcher::Observer : public MessageLoopForUI::Observer {
// WM_NCMOUSELEAVE:
// For notification when the mouse leaves the _non-client_ area.
//
- switch (msg.message) {
+ switch (event.message) {
case WM_MOUSEMOVE:
HandleGlobalMouseMoveEvent(false);
break;
@@ -61,7 +63,7 @@ class MouseWatcher::Observer : public MessageLoopForUI::Observer {
}
}
#elif defined(USE_WAYLAND)
- MessageLoopForUI::Observer::EventStatus WillProcessEvent(
+ virtual MessageLoopForUI::Observer::EventStatus WillProcessEvent(
ui::WaylandEvent* event) OVERRIDE {
switch (event->type) {
case ui::WAYLAND_MOTION:
@@ -76,11 +78,19 @@ class MouseWatcher::Observer : public MessageLoopForUI::Observer {
}
return EVENT_CONTINUE;
}
+#elif defined(TOUCH_UI) || defined(USE_AURA)
+ virtual base::EventStatus WillProcessEvent(
+ const base::NativeEvent& event) OVERRIDE {
+ return base::EVENT_CONTINUE;
+ }
+ virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE {
+ NOTIMPLEMENTED();
+ }
#elif defined(TOOLKIT_USES_GTK)
- void WillProcessEvent(GdkEvent* event) OVERRIDE {
+ virtual void WillProcessEvent(GdkEvent* event) OVERRIDE {
}
- void DidProcessEvent(GdkEvent* event) OVERRIDE {
+ virtual void DidProcessEvent(GdkEvent* event) OVERRIDE {
switch (event->type) {
case GDK_MOTION_NOTIFY:
HandleGlobalMouseMoveEvent(false);
@@ -92,11 +102,6 @@ class MouseWatcher::Observer : public MessageLoopForUI::Observer {
break;
}
}
-#else
- EventStatus WillProcessXEvent(XEvent* event) OVERRIDE {
- // TODO(davemoore) Implement.
- return EVENT_CONTINUE;
- }
#endif
private:

Powered by Google App Engine
This is Rietveld 408576698