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

Side by Side Diff: views/mouse_watcher.cc

Issue 7996008: Get views and views_unittests to build w/ use_aura=1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed some chrome changes 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/mouse_watcher.h" 5 #include "views/mouse_watcher.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 break; 69 break;
70 case ui::WAYLAND_POINTER_FOCUS: 70 case ui::WAYLAND_POINTER_FOCUS:
71 if (!event->pointer_focus.state) 71 if (!event->pointer_focus.state)
72 HandleGlobalMouseMoveEvent(true); 72 HandleGlobalMouseMoveEvent(true);
73 break; 73 break;
74 default: 74 default:
75 break; 75 break;
76 } 76 }
77 return EVENT_CONTINUE; 77 return EVENT_CONTINUE;
78 } 78 }
79 #else 79 #elif defined(TOOLKIT_USES_GTK)
80 void WillProcessEvent(GdkEvent* event) { 80 void WillProcessEvent(GdkEvent* event) {
81 } 81 }
82 82
83 void DidProcessEvent(GdkEvent* event) { 83 void DidProcessEvent(GdkEvent* event) {
84 switch (event->type) { 84 switch (event->type) {
85 case GDK_MOTION_NOTIFY: 85 case GDK_MOTION_NOTIFY:
86 HandleGlobalMouseMoveEvent(false); 86 HandleGlobalMouseMoveEvent(false);
87 break; 87 break;
88 case GDK_LEAVE_NOTIFY: 88 case GDK_LEAVE_NOTIFY:
89 HandleGlobalMouseMoveEvent(true); 89 HandleGlobalMouseMoveEvent(true);
90 break; 90 break;
91 default: 91 default:
92 break; 92 break;
93 } 93 }
94 } 94 }
95 #else
96 void WillProcessEvent(GdkEvent* event) {
sadrul 2011/09/22 17:44:31 I think this should be MessageLoopForUI::Observe
DaveMoore 2011/09/22 18:03:07 Done.
97 }
98
99 void DidProcessEvent(GdkEvent* event) {
100 }
95 #endif 101 #endif
96 102
97 private: 103 private:
98 View* view() const { return mouse_watcher_->host_; } 104 View* view() const { return mouse_watcher_->host_; }
99 105
100 // Returns whether or not the cursor is currently in the view's "zone" which 106 // Returns whether or not the cursor is currently in the view's "zone" which
101 // is defined as a slightly larger region than the view. 107 // is defined as a slightly larger region than the view.
102 bool IsCursorInViewZone() { 108 bool IsCursorInViewZone() {
103 gfx::Rect bounds = view()->GetLocalBounds(); 109 gfx::Rect bounds = view()->GetLocalBounds();
104 gfx::Point view_topleft(bounds.origin()); 110 gfx::Point view_topleft(bounds.origin());
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void MouseWatcher::Stop() { 188 void MouseWatcher::Stop() {
183 observer_.reset(NULL); 189 observer_.reset(NULL);
184 } 190 }
185 191
186 void MouseWatcher::NotifyListener() { 192 void MouseWatcher::NotifyListener() {
187 observer_.reset(NULL); 193 observer_.reset(NULL);
188 listener_->MouseMovedOutOfView(); 194 listener_->MouseMovedOutOfView();
189 } 195 }
190 196
191 } // namespace views 197 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698