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

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

Issue 22891016: Add support for rect-based event targeting in views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tab strip problems addressed Created 7 years, 2 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
Index: ui/views/widget/root_view.cc
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index 1185c755153ad47dd10df9f4459358ea97792370..411ffd7d28f3144d2bb22a44bc28715be6c3eb49 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -278,10 +278,26 @@ void RootView::DispatchGestureEvent(ui::GestureEvent* event) {
break;
}
+ // Terry: A runtime flag will specify whether or not fuzzing should be
tdanderson 2013/10/07 21:35:21 I still have to define a --use-rect-based-views-ta
+ // used here (and will possibly also specify an overlap percentage).
+ bool use_fuzzing = true;
+
+ View* gesture_handler = NULL;
+ if (use_fuzzing) {
+ // Terry: account for any possible transformations on rect?
+ gfx::Rect touch_rect(event->details().bounding_box());
+ gfx::Point origin(touch_rect.origin());
+ View::ConvertPointFromScreen(this, &origin);
+ touch_rect.set_origin(origin);
+ gesture_handler = GetEventHandlerForRect(touch_rect);
+ } else {
+ gesture_handler = GetEventHandlerForPoint(event->location());
+ }
+
// 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);
- gesture_handler_ = gesture_handler_->parent()) {
+ for (gesture_handler_ = gesture_handler;
+ 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/views/view.cc ('K') | « ui/views/view.cc ('k') | ui/views/window/non_client_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698