Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(796)

Unified Diff: ui/views/widget/root_view.cc

Issue 10790019: Add gesture target fuzzing to views (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No longer using screen coordinates Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/views/view.cc ('K') | « ui/views/view_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/root_view.cc
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index 2e799a8f2324b16b68e29a426cbc8beb5646d2c9..a2d8ef07b5e0a054c5e1e104146ee3c27375f638 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -496,10 +496,13 @@ ui::GestureStatus RootView::OnGestureEvent(const GestureEvent& event) {
return ui::GESTURE_STATUS_UNKNOWN;
}
+ gfx::Rect touch_rect(event.details().bounding_box());
+ View *v = GetEventHandlerForRect(touch_rect);
+
// Walk up the tree until we find a view that wants the gesture event.
- for (gesture_handler_ = GetEventHandlerForPoint(e.location());
- gesture_handler_ && (gesture_handler_ != this);
- gesture_handler_ = gesture_handler_->parent()) {
+ for (gesture_handler_ = v ? v : GetEventHandlerForPoint(e.location());
+ gesture_handler_ && (gesture_handler_ != this);
+ gesture_handler_ = gesture_handler_->parent()) {
if (!gesture_handler_->enabled()) {
// Disabled views eat events but are treated as not handled.
return ui::GESTURE_STATUS_UNKNOWN;
« ui/views/view.cc ('K') | « ui/views/view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698