summaryrefslogtreecommitdiffstats
path: root/ui/views/widget/root_view.cc
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-09 00:14:27 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-09 00:14:27 +0000
commitd3dbe56ed8296f5ccd843d2cb361e9b161418638 (patch)
tree4ce61a74def34bf54d805d1ff43da44da13c3dde /ui/views/widget/root_view.cc
parent7f516dc959f78ef1b678b73230cf1d38259e8cd1 (diff)
downloadchromium_src-d3dbe56ed8296f5ccd843d2cb361e9b161418638.zip
chromium_src-d3dbe56ed8296f5ccd843d2cb361e9b161418638.tar.gz
chromium_src-d3dbe56ed8296f5ccd843d2cb361e9b161418638.tar.bz2
views: Stop dispatching scroll-gesture events if the scroll-begin event wasn't handled.
BUG=153359 Review URL: https://codereview.chromium.org/11787042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/widget/root_view.cc')
-rw-r--r--ui/views/widget/root_view.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index 12c2d12..2a71020 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -288,6 +288,17 @@ void RootView::DispatchGestureEvent(ui::GestureEvent* event) {
return;
}
+ // If there was no handler for a SCROLL_BEGIN event, then subsequent scroll
+ // events are not dispatched to any views.
+ switch (event->type()) {
+ case ui::ET_GESTURE_SCROLL_UPDATE:
+ case ui::ET_GESTURE_SCROLL_END:
+ case ui::ET_SCROLL_FLING_START:
+ return;
+ default:
+ break;
+ }
+
// Walk up the tree until we find a view that wants the gesture event.
for (gesture_handler_ = GetEventHandlerForPoint(event->location());
gesture_handler_ && (gesture_handler_ != this);