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

Side by Side Diff: ui/views/controls/scrollbar/base_scroll_bar.cc

Issue 2189583004: [not for review - epic CL] Adding Elastic+Momentum+Layered scrolling to views::ScrollView Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/scrollbar/base_scroll_bar.h" 5 #include "ui/views/controls/scrollbar/base_scroll_bar.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 return true; 187 return true;
188 } 188 }
189 return false; 189 return false;
190 } 190 }
191 191
192 bool BaseScrollBar::OnMouseWheel(const ui::MouseWheelEvent& event) { 192 bool BaseScrollBar::OnMouseWheel(const ui::MouseWheelEvent& event) {
193 OnScroll(event.x_offset(), event.y_offset()); 193 OnScroll(event.x_offset(), event.y_offset());
194 return true; 194 return true;
195 } 195 }
196 196
197 void BaseScrollBar::OnScrollEvent(ui::ScrollEvent* event) {
198 controller()->OnScrollEventFromScrollBar(event);
199 }
200
197 void BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) { 201 void BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) {
198 // If a fling is in progress, then stop the fling for any incoming gesture 202 // If a fling is in progress, then stop the fling for any incoming gesture
199 // event (except for the GESTURE_END event that is generated at the end of the 203 // event (except for the GESTURE_END event that is generated at the end of the
200 // fling). 204 // fling).
201 if (scroll_animator_.get() && scroll_animator_->is_scrolling() && 205 if (scroll_animator_.get() && scroll_animator_->is_scrolling() &&
202 (event->type() != ui::ET_GESTURE_END || 206 (event->type() != ui::ET_GESTURE_END ||
203 event->details().touch_points() > 1)) { 207 event->details().touch_points() > 1)) {
204 scroll_animator_->Stop(); 208 scroll_animator_->Stop();
205 } 209 }
206 210
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 return (thumb_position * (contents_size_ - viewport_size_)) / 510 return (thumb_position * (contents_size_ - viewport_size_)) /
507 (track_size - thumb_size); 511 (track_size - thumb_size);
508 } 512 }
509 513
510 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) { 514 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) {
511 thumb_track_state_ = state; 515 thumb_track_state_ = state;
512 SchedulePaint(); 516 SchedulePaint();
513 } 517 }
514 518
515 } // namespace views 519 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/base_scroll_bar.h ('k') | ui/views/controls/scrollbar/cocoa_scroll_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698