Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: ui/views/controls/scroll_view.cc

Issue 2454323002: MacViews: Reveal scrollbars when resting on the trackpad. (Closed)
Patch Set: fix compile Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/scroll_view.cc
diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
index b62972d894f5f99ea6e2fd30ba37486025bf7bb6..87e1414d86e4320b14836ef67c52dd8f36e3a185 100644
--- a/ui/views/controls/scroll_view.cc
+++ b/ui/views/controls/scroll_view.cc
@@ -472,9 +472,20 @@ void ScrollView::OnMouseExited(const ui::MouseEvent& event) {
void ScrollView::OnScrollEvent(ui::ScrollEvent* event) {
#if defined(OS_MACOSX)
+ 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.
+
+ // 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
+ // UI feedback once the scrolling direction is known.
+ if (horiz_sb_)
+ horiz_sb_->ObserveScrollEvent(*event);
+ if (vert_sb_)
+ vert_sb_->ObserveScrollEvent(*event);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698