| Index: ui/views/widget/root_view.cc
|
| diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
|
| index e29ced9afb1e24c2c5ffc76b3aafa179d4efca7d..c7303b5ec194bf7dec91b428cd501df90ef955c5 100644
|
| --- a/ui/views/widget/root_view.cc
|
| +++ b/ui/views/widget/root_view.cc
|
| @@ -16,6 +16,7 @@
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/views/focus/view_storage.h"
|
| #include "ui/views/layout/fill_layout.h"
|
| +#include "ui/views/views_switches.h"
|
| #include "ui/views/widget/widget.h"
|
| #include "ui/views/widget/widget_delegate.h"
|
| #include "ui/views/widget/widget_deletion_observer.h"
|
| @@ -286,10 +287,21 @@ void RootView::DispatchGestureEvent(ui::GestureEvent* event) {
|
| break;
|
| }
|
|
|
| + View* gesture_handler = NULL;
|
| + if (views::switches::UseRectBasedTargeting()) {
|
| + 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;
|
|
|