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

Unified Diff: ui/views/window/non_client_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
« ui/views/view.cc ('K') | « ui/views/window/non_client_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/non_client_view.cc
diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc
index 68a804056eff599142ae7ad09d0c7bfe358fb5a6..1d82fb225bf1a8a86f58b81f11caa46f8420b270 100644
--- a/ui/views/window/non_client_view.cc
+++ b/ui/views/window/non_client_view.cc
@@ -178,7 +178,7 @@ views::View* NonClientView::GetEventHandlerForPoint(const gfx::Point& point) {
// removed from the NonClientView.
gfx::Point point_in_child_coords(point);
View::ConvertPointToView(this, frame_view_.get(), &point_in_child_coords);
- if (frame_view_->HitTest(point_in_child_coords))
+ if (frame_view_->HitTest(gfx::Rect(point_in_child_coords, gfx::Size(0, 0))))
return frame_view_->GetEventHandlerForPoint(point_in_child_coords);
}
@@ -247,10 +247,14 @@ int NonClientFrameView::GetHTComponentForFrame(const gfx::Point& point,
////////////////////////////////////////////////////////////////////////////////
// NonClientFrameView, View overrides:
-bool NonClientFrameView::HitTest(const gfx::Point& l) const {
+bool NonClientFrameView::HitTest(const gfx::Rect& r) const {
// For the default case, we assume the non-client frame view never overlaps
// the client view.
- return !GetWidget()->client_view()->bounds().Contains(l);
+ if (r.IsEmpty())
+ return !GetWidget()->client_view()->bounds().Contains(gfx::Point(r.x(),
sky 2012/08/07 20:11:43 r.origin()
tdanderson 2012/08/08 23:47:51 Done.
+ r.y()));
+ return !GetWidget()->client_view()->bounds().Intersects(r);
+
}
////////////////////////////////////////////////////////////////////////////////
« ui/views/view.cc ('K') | « ui/views/window/non_client_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698