summaryrefslogtreecommitdiffstats
path: root/ui/views/view.cc
diff options
context:
space:
mode:
authortdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-05 22:28:50 +0000
committertdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-05 22:28:50 +0000
commit11f57949d5726af24f66cdec331347afe14bfc8e (patch)
tree6361fd6140dd6f3e9d94108477163a83901afcc5 /ui/views/view.cc
parenta58554aaf521e3c2f61a86f7b9bf34d2a5204525 (diff)
downloadchromium_src-11f57949d5726af24f66cdec331347afe14bfc8e.zip
chromium_src-11f57949d5726af24f66cdec331347afe14bfc8e.tar.gz
chromium_src-11f57949d5726af24f66cdec331347afe14bfc8e.tar.bz2
Do not call into EventTargeter methods from ViewTargeter
Now that hit-testing for views (crbug.com/388838) and event-targeting for views (crbug.com/391845) use ViewTargeterDelegate to define custom behaviour for these operations (instead of the now-obsolete approach of subclassing ViewTargeter itself), we should not be calling into EventTargeter for this purpose. Changes in this CL: * Finding the target of a scroll event is now performed correctly by using the logic in ViewTargeterDelegate and its overrides. * The dead code ViewTargeter::SubtreeCanAcceptEvent(), ViewTargeter::EventLocationInsideBounds(), and ViewTargeter::BoundsForEvent() have been removed along with their corresponding tests. * The class-level documentation for ViewTargeter and ViewTargeterDelegate has been updated to clarify the purpose of these classes. BUG=395387,370579 TEST=ViewTargeterTest.* Review URL: https://codereview.chromium.org/426443002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/view.cc')
-rw-r--r--ui/views/view.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 290dfda..349b0dd 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1030,6 +1030,15 @@ View::SetEventTargeter(scoped_ptr<ViewTargeter> targeter) {
return old_targeter.Pass();
}
+ViewTargeter* View::GetEffectiveViewTargeter() const {
+ DCHECK(GetWidget());
+ ViewTargeter* view_targeter = targeter();
+ if (!view_targeter)
+ view_targeter = GetWidget()->GetRootView()->targeter();
+ CHECK(view_targeter);
+ return view_targeter;
+}
+
bool View::CanAcceptEvent(const ui::Event& event) {
return IsDrawn();
}
@@ -2270,14 +2279,6 @@ void View::ProcessMouseReleased(const ui::MouseEvent& event) {
// WARNING: we may have been deleted.
}
-ViewTargeter* View::GetEffectiveViewTargeter() const {
- ViewTargeter* view_targeter = targeter();
- if (!view_targeter)
- view_targeter = GetWidget()->GetRootView()->targeter();
- CHECK(view_targeter);
- return view_targeter;
-}
-
// Accelerators ----------------------------------------------------------------
void View::RegisterPendingAccelerators() {