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..7359c52d0d3dc1ba79008f74481096073363cdbc 100644 |
--- a/ui/views/widget/root_view.cc |
+++ b/ui/views/widget/root_view.cc |
@@ -249,55 +249,36 @@ 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); |
- |
+void RootView::OnEventProcessingStarted(ui::Event* event) { |
if (event->IsGestureEvent()) { |
sadrul
2014/09/25 16:12:01
Early return if !gesture-event instead
tdanderson
2014/09/25 17:11:58
Done.
|
- // 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. |
ui::GestureEvent* gesture_event = event->AsGestureEvent(); |
- // Do not dispatch ui::ET_GESTURE_BEGIN events. |
- if (gesture_event->type() == ui::ET_GESTURE_BEGIN) |
- return DispatchDetails(); |
+ // Do not process ui::ET_GESTURE_BEGIN events. |
+ if (gesture_event->type() == ui::ET_GESTURE_BEGIN) { |
+ event->SetHandled(); |
+ return; |
+ } |
- // 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(); |
+ event->SetHandled(); |
+ return; |
} |
- // 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(); |
+ event->SetHandled(); |
+ return; |
} |
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(); |
} |
void RootView::OnEventProcessingFinished(ui::Event* event) { |