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

Unified Diff: chrome/browser/ui/views/frame/glass_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: 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/glass_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index ae6197a689832e683be342f6b09a2ee897d2a8df..3d2e6f9f45309de131379b9d4750ff0ee2eb15ab 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -238,10 +238,16 @@ void GlassBrowserFrameView::Layout() {
LayoutClientView();
}
-bool GlassBrowserFrameView::HitTest(const gfx::Point& l) const {
+bool GlassBrowserFrameView::HitTest(const gfx::Rect& r) const {
+ if (r.IsEmpty()) {
+ gfx::Point p(r.x(), r.y());
+ return (avatar_button() &&
+ avatar_button()->GetMirroredBounds().Contains(p)) ||
+ !frame()->client_view()->bounds().Contains(p);
+ }
return (avatar_button() &&
- avatar_button()->GetMirroredBounds().Contains(l)) ||
- !frame()->client_view()->bounds().Contains(l);
+ avatar_button()->GetMirroredBounds().Intersects(r)) ||
+ !frame()->client_view()->bounds().Intersects(r);
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698