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

Side by Side Diff: views/mouse_watcher.cc

Issue 6462022: It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/screen.h" 10 #include "views/screen.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 } 74 }
75 #endif 75 #endif
76 76
77 private: 77 private:
78 View* view() const { return mouse_watcher_->host_; } 78 View* view() const { return mouse_watcher_->host_; }
79 79
80 // Returns whether or not the cursor is currently in the view's "zone" which 80 // Returns whether or not the cursor is currently in the view's "zone" which
81 // is defined as a slightly larger region than the view. 81 // is defined as a slightly larger region than the view.
82 bool IsCursorInViewZone() { 82 bool IsCursorInViewZone() {
83 gfx::Rect bounds = view()->GetContentsBounds(); 83 gfx::Rect bounds = view()->GetLocalBounds();
84 gfx::Point view_topleft(bounds.origin()); 84 gfx::Point view_topleft(bounds.origin());
85 View::ConvertPointToScreen(view(), &view_topleft); 85 View::ConvertPointToScreen(view(), &view_topleft);
86 bounds.set_origin(view_topleft); 86 bounds.set_origin(view_topleft);
87 bounds.SetRect(view_topleft.x() - mouse_watcher_->hot_zone_insets_.left(), 87 bounds.SetRect(view_topleft.x() - mouse_watcher_->hot_zone_insets_.left(),
88 view_topleft.y() - mouse_watcher_->hot_zone_insets_.top(), 88 view_topleft.y() - mouse_watcher_->hot_zone_insets_.top(),
89 bounds.width() + mouse_watcher_->hot_zone_insets_.width(), 89 bounds.width() + mouse_watcher_->hot_zone_insets_.width(),
90 bounds.height() + mouse_watcher_->hot_zone_insets_.height()); 90 bounds.height() + mouse_watcher_->hot_zone_insets_.height());
91 91
92 gfx::Point cursor_point = Screen::GetCursorScreenPoint(); 92 gfx::Point cursor_point = Screen::GetCursorScreenPoint();
93 93
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void MouseWatcher::Stop() { 158 void MouseWatcher::Stop() {
159 observer_.reset(NULL); 159 observer_.reset(NULL);
160 } 160 }
161 161
162 void MouseWatcher::NotifyListener() { 162 void MouseWatcher::NotifyListener() {
163 observer_.reset(NULL); 163 observer_.reset(NULL);
164 listener_->MouseMovedOutOfView(); 164 listener_->MouseMovedOutOfView();
165 } 165 }
166 166
167 } // namespace views 167 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698