Call into ViewTargeter from View::HitTestRect()
commit3ebcdf15906e2cd2e99593eea2085413d7783673
authortdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 3 Jul 2014 19:59:25 +0000 (3 19:59 +0000)
committertdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 3 Jul 2014 19:59:25 +0000 (3 19:59 +0000)
tree899bb8878f0aa6f08299c9f9775f9df8d02bf866
parentf7a1e75b15a808160fce0688e9bbdc4e1a423800
Call into ViewTargeter from View::HitTestRect()

Add a ViewTargeterDelegate member to ViewTargeter, which
is a weak pointer back to the View on which the targeter
is installed. Make RootView subclass ViewTargeterDelegate
so that it can be installed as the delegate on its
ViewTargeter.

Change the default implementation of View::HitTestRect()
to call into the ViewTargeter installed on |this| (or
instead on the ViewTargeter installed on the root view
if |this| does not have its own targeter installed).
This will allow all custom hit-testing logic to be moved
out of View::HitTestRect() overrides and into
ViewTargeterDelegate::DoesIntersectRect() overrides
instead.

BUG=388838
TBR=sky@chromium.org
TEST=ViewTargeterTest.DoesIntersectRect augmented, all existing tests involving hit testing

Review URL: https://codereview.chromium.org/360383002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281314 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/ui/views/tabs/tab_strip_unittest.cc
ui/views/controls/label_unittest.cc
ui/views/view.cc
ui/views/view_targeter.cc
ui/views/view_targeter.h
ui/views/view_targeter_unittest.cc
ui/views/widget/root_view.cc
ui/views/widget/root_view.h
ui/views/widget/root_view_unittest.cc