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

Unified Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 10827198: Change View::HitTest to View::HitTestRect (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed errors reported by trybots Created 8 years, 4 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: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index e11d10c96649f381ee139b8586be176129d3543d..58b2d92a3ddc6b79a9a49a9c922329bba085fd33 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -401,9 +401,9 @@ void OpaqueBrowserFrameView::Layout() {
client_view_bounds_ = CalculateClientAreaBounds(width(), height());
}
-bool OpaqueBrowserFrameView::HitTest(const gfx::Point& l) const {
- // If the point is outside the bounds of the client area, claim it.
- bool in_nonclient = NonClientFrameView::HitTest(l);
+bool OpaqueBrowserFrameView::HitTestRect(const gfx::Rect& rect) const {
+ // If |rect| does not intersect the bounds of the client area, claim it.
+ bool in_nonclient = NonClientFrameView::HitTestRect(rect);
if (in_nonclient)
return in_nonclient;
@@ -414,13 +414,15 @@ bool OpaqueBrowserFrameView::HitTest(const gfx::Point& l) const {
gfx::Point tabstrip_origin(tabstrip_bounds.origin());
View::ConvertPointToView(frame()->client_view(), this, &tabstrip_origin);
tabstrip_bounds.set_origin(tabstrip_origin);
- if (l.y() > tabstrip_bounds.bottom())
+ if (rect.bottom() > tabstrip_bounds.bottom())
return false;
// We convert from our parent's coordinates since we assume we fill its bounds
// completely. We need to do this since we're not a parent of the tabstrip,
// meaning ConvertPointToView would otherwise return something bogus.
- gfx::Point browser_view_point(l);
+ // TODO(tdanderson): Initialize |browser_view_point| using |rect| instead of
+ // its center point once GetEventHandlerForRect() is implemented.
+ gfx::Point browser_view_point(rect.CenterPoint());
View::ConvertPointToView(parent(), browser_view(), &browser_view_point);
return browser_view()->IsPositionInWindowCaption(browser_view_point);
}
« no previous file with comments | « chrome/browser/ui/views/frame/opaque_browser_frame_view.h ('k') | chrome/browser/ui/views/fullscreen_exit_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698