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

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: 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/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..457da8926096f368e726fb9ba98a6a9928fcda10 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,15 @@ 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);
+ // 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/ash/browser_non_client_frame_view_ash.h ('k') | chrome/browser/ui/views/avatar_menu_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698