| Index: ui/views/controls/scroll_view.cc
|
| diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
|
| index cf212b7c8bd3c99d10b268ab234d9acf05508a54..d619021166c2cfbdb153ee1878527df60f4000b0 100644
|
| --- a/ui/views/controls/scroll_view.cc
|
| +++ b/ui/views/controls/scroll_view.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/feature_list.h"
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| +#include "ui/compositor/overscroll/ui_scroll_input_manager.h"
|
| #include "ui/events/event.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/native_theme/native_theme.h"
|
| @@ -460,9 +461,13 @@ void ScrollView::OnScrollEvent(ui::ScrollEvent* event) {
|
| if (!contents_)
|
| return;
|
|
|
| - // TODO(tapted): Send |event| to a cc::InputHandler. For now, there's nothing
|
| - // to do because Widget::OnScrollEvent() will automatically process an
|
| - // unhandled ScrollEvent as a MouseWheelEvent.
|
| + ui::UIScrollInputManager* compositor_scroller =
|
| + GetWidget()->GetCompositor()->scroll_input_manager();
|
| + DCHECK(compositor_scroller);
|
| + if (compositor_scroller->OnScrollEvent(*event, contents_->layer())) {
|
| + event->SetHandled();
|
| + event->StopPropagation();
|
| + }
|
|
|
| // A direction might not be known when the event stream starts, notify both
|
| // scrollbars that they may be about scroll, or that they may need to cancel
|
| @@ -545,6 +550,16 @@ int ScrollView::GetScrollIncrement(ScrollBar* source, bool is_page,
|
| contents_viewport_->height() / 5;
|
| }
|
|
|
| +void ScrollView::OnScrollEventFromScrollBar(ui::ScrollEvent* event) {
|
| + // Note that |event| can't be used for hit-testing in the cc::InputHandler
|
| + // as-is, since it will hit a scroll bar Layer. Layer scrolling supports that,
|
| + // but only if the scroll bar track and thumb Layers implement
|
| + // cc::ScrollbarLayerInterface. Creating one of those requires a cc::ScrollBar
|
| + // instance which is more than views:: really needs to care about. The
|
| + // following works because ScrollView explicitly passes the Layer to scroll.
|
| + OnScrollEvent(event);
|
| +}
|
| +
|
| void ScrollView::SetHeaderOrContents(View* parent,
|
| View* new_view,
|
| View** member) {
|
|
|