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

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: sadrul's comments about testing addressed Created 8 years, 5 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_constants.h ('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..ac6c38c77a1ae6c7d911bf23cd7d0ceb4c75d16d 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -496,10 +496,16 @@ ui::GestureStatus RootView::OnGestureEvent(const GestureEvent& event) {
return ui::GESTURE_STATUS_UNKNOWN;
}
+ gfx::Rect touch_rect(event.details().bounding_box());
+ gfx::Point touch_rect_location(touch_rect.x(), touch_rect.y());
+ ConvertPointToScreen(this, &touch_rect_location);
+ touch_rect.set_origin(touch_rect_location);
+ 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());
sky 2012/08/02 15:52:08 Seems wierd to fallback to GetEventHandlerForPoint
tdanderson 2012/08/02 18:11:37 The fallback is the intended behavior since GetEve
+ 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_constants.h ('K') | « ui/views/view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698