| Index: ui/views/controls/scroll_view.cc
|
| diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
|
| index 68ee68fee3eaa8561e097be266a8ec202f448155..fdabd1026e2b46d322c3639bdceb95d0da4afe6a 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"
|
| @@ -461,9 +462,13 @@ void ScrollView::OnMouseExited(const ui::MouseEvent& event) {
|
|
|
| void ScrollView::OnScrollEvent(ui::ScrollEvent* event) {
|
| #if defined(OS_MACOSX)
|
| - // 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)) {
|
| + event->SetHandled();
|
| + event->StopPropagation();
|
| + }
|
| #endif
|
| }
|
|
|
| @@ -538,6 +543,19 @@ int ScrollView::GetScrollIncrement(ScrollBar* source, bool is_page,
|
| contents_viewport_->height() / 5;
|
| }
|
|
|
| +void ScrollView::OnScrollEventFromScrollBar(ui::ScrollEvent* event) {
|
| + // If the scroll event is passed to the cc::InputHandler as-is, then 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. For now, cheat a little and pretend
|
| + // events are coming from the point (0, 0) on the viewport.
|
| + gfx::Point location;
|
| + ConvertPointToWidget(contents_viewport_, &location);
|
| + event->set_location(location);
|
| + OnScrollEvent(event);
|
| +}
|
| +
|
| void ScrollView::SetHeaderOrContents(View* parent,
|
| View* new_view,
|
| View** member) {
|
|
|