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

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

Issue 456913002: MacViews: Support continuous scrolling and horizontal scrolling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for rsesek Created 6 years, 3 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 | Annotate | Revision Log
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 break; 187 break;
188 } 188 }
189 if (amount != SCROLL_NONE) { 189 if (amount != SCROLL_NONE) {
190 ScrollByAmount(amount); 190 ScrollByAmount(amount);
191 return true; 191 return true;
192 } 192 }
193 return false; 193 return false;
194 } 194 }
195 195
196 bool BaseScrollBar::OnMouseWheel(const ui::MouseWheelEvent& event) { 196 bool BaseScrollBar::OnMouseWheel(const ui::MouseWheelEvent& event) {
197 ScrollByContentsOffset(event.y_offset()); 197 OnScroll(event.x_offset(), event.y_offset());
198 return true; 198 return true;
199 } 199 }
200 200
201 void BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) { 201 void BaseScrollBar::OnGestureEvent(ui::GestureEvent* event) {
202 // 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
203 // 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
204 // fling). 204 // fling).
205 if (scroll_animator_.get() && scroll_animator_->is_scrolling() && 205 if (scroll_animator_.get() && scroll_animator_->is_scrolling() &&
206 (event->type() != ui::ET_GESTURE_END || 206 (event->type() != ui::ET_GESTURE_END ||
207 event->details().touch_points() > 1)) { 207 event->details().touch_points() > 1)) {
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 thumb_position = thumb_position - (thumb_->GetSize() / 2); 508 thumb_position = thumb_position - (thumb_->GetSize() / 2);
509 return (thumb_position * contents_size_) / GetTrackSize(); 509 return (thumb_position * contents_size_) / GetTrackSize();
510 } 510 }
511 511
512 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) { 512 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) {
513 thumb_track_state_ = state; 513 thumb_track_state_ = state;
514 SchedulePaint(); 514 SchedulePaint();
515 } 515 }
516 516
517 } // namespace views 517 } // namespace views
OLDNEW
« ui/views/controls/scroll_view.cc ('K') | « ui/views/controls/scroll_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698