Index: ui/views/widget/root_view.cc |
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc |
index 5b0de0bc65ef63f85f4f593c24587890e4543990..12c2d12cbb37feb7b0a530af2899544f72ae886e 100644 |
--- a/ui/views/widget/root_view.cc |
+++ b/ui/views/widget/root_view.cc |
@@ -139,6 +139,30 @@ void RootView::DispatchScrollEvent(ui::ScrollEvent* event) { |
v && v != this && !event->stopped_propagation(); v = v->parent()) { |
v->OnScrollEvent(event); |
} |
+ |
+ if (event->handled() || event->type() != ui::ET_SCROLL) |
+ return; |
+ |
+ // Convert unprocessed scroll events into mouse-wheel events. Note that |
+ // wheel events are normally sent to the focused view. However, if the focused |
+ // view does not process these wheel events, then dispatch them to the view |
+ // under the cursor. |
+ ui::MouseWheelEvent wheel(*event); |
+ if (OnMouseWheel(wheel)) { |
+ event->SetHandled(); |
+ } else { |
+ View* focused_view = |
+ GetFocusManager() ? GetFocusManager()->GetFocusedView() : NULL; |
+ View* v = GetEventHandlerForPoint(wheel.location()); |
+ if (v != focused_view) { |
+ for (; v && v != this; v = v->parent()) { |
+ if (v->OnMouseWheel(wheel)) { |
+ event->SetHandled(); |
+ break; |
+ } |
+ } |
+ } |
+ } |
} |
void RootView::DispatchTouchEvent(ui::TouchEvent* event) { |