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 e4068dba177258768502ef22b8fc0b5f1da27674..d77fd8502a4c681eb7e37032a1ac5ddb7e0b214a 100644 |
--- a/ui/views/window/non_client_view.cc |
+++ b/ui/views/window/non_client_view.cc |
@@ -8,6 +8,7 @@ |
#include "ui/base/hit_test.h" |
#include "ui/gfx/rect_conversions.h" |
#include "ui/views/rect_based_targeting_utils.h" |
+#include "ui/views/view_targeter.h" |
#include "ui/views/widget/root_view.h" |
#include "ui/views/widget/widget.h" |
#include "ui/views/window/client_view.h" |
@@ -35,6 +36,8 @@ static const int kClientViewIndex = 1; |
NonClientView::NonClientView() |
: client_view_(NULL), |
overlay_view_(NULL) { |
+ SetEventTargeter( |
+ scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); |
} |
NonClientView::~NonClientView() { |
@@ -186,9 +189,13 @@ const char* NonClientView::GetClassName() const { |
return kViewClassName; |
} |
-View* NonClientView::GetEventHandlerForRect(const gfx::Rect& rect) { |
+// Terry - move to right place in file |
+View* NonClientView::TargetForRect(View* root, |
+ const gfx::Rect& rect) { |
+ CHECK_EQ(root, this); |
+ |
if (!UsePointBasedTargeting(rect)) |
- return View::GetEventHandlerForRect(rect); |
+ return ViewTargeterDelegate::TargetForRect(root, 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 |
@@ -209,7 +216,7 @@ View* NonClientView::GetEventHandlerForRect(const gfx::Rect& rect) { |
return frame_view_->GetEventHandlerForRect(rect_in_child_coords); |
} |
- return View::GetEventHandlerForRect(rect); |
+ return ViewTargeterDelegate::TargetForRect(root, rect); |
} |
View* NonClientView::GetTooltipHandlerForPoint(const gfx::Point& point) { |
@@ -301,9 +308,12 @@ int NonClientFrameView::GetHTComponentForFrame(const gfx::Point& point, |
} |
//////////////////////////////////////////////////////////////////////////////// |
-// NonClientFrameView, View overrides: |
+// NonClientFrameView, ViewTargeterDelegate overrides: |
+ |
+bool NonClientFrameView::DoesIntersectRect(const View* target, |
+ const gfx::Rect& rect) const { |
+ CHECK_EQ(target, this); |
-bool NonClientFrameView::HitTestRect(const gfx::Rect& rect) const { |
// For the default case, we assume the non-client frame view never overlaps |
// the client view. |
return !GetWidget()->client_view()->bounds().Intersects(rect); |
@@ -326,6 +336,9 @@ void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
} |
NonClientFrameView::NonClientFrameView() : inactive_rendering_disabled_(false) { |
+ // Terry - the right place for this? |
+ SetEventTargeter( |
+ scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); |
} |
} // namespace views |