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 316d00f3643abcb875982d2fb7e29906755fb54e..09d663f736aebe877e1694ff665a28555f5007b9 100644 |
--- a/ui/views/window/non_client_view.cc |
+++ b/ui/views/window/non_client_view.cc |
@@ -188,10 +188,13 @@ const char* NonClientView::GetClassName() const { |
return kViewClassName; |
} |
-views::View* NonClientView::GetEventHandlerForPoint(const gfx::Point& point) { |
+views::View* NonClientView::GetEventHandlerForRect(const gfx::Rect& rect) { |
+ if (!View::UsePointBasedTargeting(rect)) |
+ return View::GetEventHandlerForRect(rect); |
+ |
// Because of the z-ordering of our child views (the client view is positioned |
// over the non-client frame view, if the client view ever overlaps the frame |
- // view visually (as it does for the browser window), then it will eat mouse |
+ // view visually (as it does for the browser window), then it will eat |
// events for the window controls. We override this method here so that we can |
// detect this condition and re-route the events to the non-client frame view. |
// The assumption is that the frame view's implementation of HitTest will only |
@@ -200,17 +203,17 @@ views::View* NonClientView::GetEventHandlerForPoint(const gfx::Point& point) { |
// During the reset of the frame_view_ it's possible to be in this code |
// after it's been removed from the view hierarchy but before it's been |
// removed from the NonClientView. |
- gfx::Point point_in_child_coords(point); |
- View::ConvertPointToTarget(this, frame_view_.get(), &point_in_child_coords); |
- if (frame_view_->HitTestPoint(point_in_child_coords)) |
- return frame_view_->GetEventHandlerForPoint(point_in_child_coords); |
+ gfx::Rect rect_in_child_coords(rect); |
+ View::ConvertRectToTarget(this, frame_view_.get(), &rect_in_child_coords); |
+ if (frame_view_->HitTestRect(rect_in_child_coords)) |
+ return frame_view_->GetEventHandlerForRect(rect_in_child_coords); |
} |
- return View::GetEventHandlerForPoint(point); |
+ return View::GetEventHandlerForRect(rect); |
} |
views::View* NonClientView::GetTooltipHandlerForPoint(const gfx::Point& point) { |
- // The same logic as for |GetEventHandlerForPoint()| applies here. |
+ // The same logic as for |GetEventHandlerForRect()| applies here. |
if (frame_view_->parent() == this) { |
// During the reset of the frame_view_ it's possible to be in this code |
// after it's been removed from the view hierarchy but before it's been |