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

Unified Diff: chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc

Issue 10827198: Change View::HitTest to View::HitTestRect (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revised patch with tests added 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/ash/browser_non_client_frame_view_ash.cc
diff --git a/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
index c8844b48083f57393a272c3831cd632687aa827d..150b62e40626b140fc91607ceef0e2db8f09e366 100644
--- a/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
@@ -332,9 +332,9 @@ std::string BrowserNonClientFrameViewAsh::GetClassName() const {
return kViewClassName;
}
-bool BrowserNonClientFrameViewAsh::HitTest(const gfx::Point& l) const {
- // If the point is outside the bounds of the client area, claim it.
- if (NonClientFrameView::HitTest(l))
+bool BrowserNonClientFrameViewAsh::HitTestRect(const gfx::Rect& rect) const {
+ // If the rect is outside the bounds of the client area, claim it.
+ if (NonClientFrameView::HitTestRect(rect))
return true;
// Otherwise claim it only if it's in a non-tab portion of the tabstrip.
@@ -344,13 +344,13 @@ bool BrowserNonClientFrameViewAsh::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);
+ gfx::Point browser_view_point(rect.CenterPoint());
View::ConvertPointToView(parent(), browser_view(), &browser_view_point);
return browser_view()->IsPositionInWindowCaption(browser_view_point);
}

Powered by Google App Engine
This is Rietveld 408576698