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

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

Issue 2454323002: MacViews: Reveal scrollbars when resting on the trackpad. (Closed)
Patch Set: rebase for r432358 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
« no previous file with comments | « ui/events/test/event_generator.cc ('k') | ui/views/controls/scroll_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scroll_view.cc
diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
index 77c12b62bb4d38433baa99085a54002a3dc2e1b0..8a0c2590e8d2eae11644a63eddd61455fc6c0fa6 100644
--- a/ui/views/controls/scroll_view.cc
+++ b/ui/views/controls/scroll_view.cc
@@ -458,9 +458,20 @@ bool ScrollView::OnMouseWheel(const ui::MouseWheelEvent& e) {
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
}
« no previous file with comments | « ui/events/test/event_generator.cc ('k') | ui/views/controls/scroll_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698