Chromium Code Reviews| Index: ui/views/widget/root_view.cc |
| diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc |
| index d05f1d8fd7bd2919ed6eab3ddf6ae5a9766d1215..85379f0a23cfc2f4978e8002e93addc5935be760 100644 |
| --- a/ui/views/widget/root_view.cc |
| +++ b/ui/views/widget/root_view.cc |
| @@ -249,55 +249,33 @@ ui::EventTarget* RootView::GetRootTarget() { |
| return this; |
| } |
| -ui::EventDispatchDetails RootView::OnEventFromSource(ui::Event* event) { |
| - if (event->IsKeyEvent()) |
| - return EventProcessor::OnEventFromSource(event); |
| - |
| - if (event->IsScrollEvent()) |
| - return EventProcessor::OnEventFromSource(event); |
| - |
| +bool RootView::OnEventProcessingStarted(ui::Event* event) { |
| if (event->IsGestureEvent()) { |
| - // TODO(tdanderson): Once DispatchGestureEvent() has been removed, move |
| - // all of this logic into an override of a new |
| - // virtual method |
| - // EventProcessor::OnEventProcessingStarted() (which |
| - // returns false if no processing should take place). |
| - // Also move the implementation of |
| - // PrepareEventForDispatch() into this new method. |
| - // Then RootView::OnEventFromSource() can be removed. |
| + gesture_handler_set_before_processing_ = !!gesture_handler_; |
|
sadrul
2014/09/15 14:10:36
Should you move this down so this is set only when
tdanderson
2014/09/15 18:20:26
With the CL as-is, this will need to stay where it
|
| ui::GestureEvent* gesture_event = event->AsGestureEvent(); |
| - // Do not dispatch ui::ET_GESTURE_BEGIN events. |
| + // Do not process ui::ET_GESTURE_BEGIN events. |
| if (gesture_event->type() == ui::ET_GESTURE_BEGIN) |
| - return DispatchDetails(); |
| + return false; |
| - // Ignore ui::ET_GESTURE_END events which do not correspond to the |
| + // Do not process ui::ET_GESTURE_END events which do not correspond to the |
| // removal of the final touch point. |
| if (gesture_event->type() == ui::ET_GESTURE_END && |
| gesture_event->details().touch_points() > 1) { |
| - return DispatchDetails(); |
| + return false; |
| } |
| - // Ignore subsequent gesture scroll events if no handler was set for a |
| - // ui::ET_GESTURE_SCROLL_BEGIN event. |
| + // Do not process subsequent gesture scroll events if no handler was set for |
| + // a ui::ET_GESTURE_SCROLL_BEGIN event. |
| if (!gesture_handler_ && |
| (gesture_event->type() == ui::ET_GESTURE_SCROLL_UPDATE || |
| gesture_event->type() == ui::ET_GESTURE_SCROLL_END || |
| gesture_event->type() == ui::ET_SCROLL_FLING_START)) { |
| - return DispatchDetails(); |
| + return false; |
| } |
| - |
| - gesture_handler_set_before_processing_ = !!gesture_handler_; |
| - return EventProcessor::OnEventFromSource(event); |
| } |
| - if (event->IsTouchEvent()) |
| - NOTREACHED() << "Touch events should not be sent to RootView."; |
| - |
| - if (event->IsMouseEvent()) |
| - NOTREACHED() << "Should not be called with a MouseEvent."; |
| - |
| - return DispatchDetails(); |
| + return true; |
| } |
| void RootView::OnEventProcessingFinished(ui::Event* event) { |