| OLD | NEW |
| 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 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_H_ |
| 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/views/animation/scroll_animator.h" | 10 #include "ui/views/animation/scroll_animator.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // the |this| scrollbar, for native scrollbars it's the native scrollbar used | 101 // the |this| scrollbar, for native scrollbars it's the native scrollbar used |
| 102 // to create this. | 102 // to create this. |
| 103 virtual void ScrollToPosition(int position); | 103 virtual void ScrollToPosition(int position); |
| 104 virtual int GetScrollIncrement(bool is_page, bool is_positive); | 104 virtual int GetScrollIncrement(bool is_page, bool is_positive); |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 friend class test::ScrollViewTestApi; | 107 friend class test::ScrollViewTestApi; |
| 108 | 108 |
| 109 FRIEND_TEST_ALL_PREFIXES(ScrollBarViewsTest, ScrollBarFitsToBottom); | 109 FRIEND_TEST_ALL_PREFIXES(ScrollBarViewsTest, ScrollBarFitsToBottom); |
| 110 FRIEND_TEST_ALL_PREFIXES(ScrollBarViewsTest, ThumbFullLengthOfTrack); | 110 FRIEND_TEST_ALL_PREFIXES(ScrollBarViewsTest, ThumbFullLengthOfTrack); |
| 111 static base::Timer* GetHideTimerForTest(BaseScrollBar* scroll_bar); |
| 111 int GetThumbSizeForTest(); | 112 int GetThumbSizeForTest(); |
| 112 | 113 |
| 113 // Changes to 'pushed' state and starts a timer to scroll repeatedly. | 114 // Changes to 'pushed' state and starts a timer to scroll repeatedly. |
| 114 void ProcessPressEvent(const ui::LocatedEvent& event); | 115 void ProcessPressEvent(const ui::LocatedEvent& event); |
| 115 | 116 |
| 116 // Called when the mouse is pressed down in the track area. | 117 // Called when the mouse is pressed down in the track area. |
| 117 void TrackClicked(); | 118 void TrackClicked(); |
| 118 | 119 |
| 119 // Responsible for scrolling the contents and also updating the UI to the | 120 // Responsible for scrolling the contents and also updating the UI to the |
| 120 // current value of the Scroll Offset. | 121 // current value of the Scroll Offset. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // TODO(tdresser): This should be removed when raw pixel scrolling for views | 171 // TODO(tdresser): This should be removed when raw pixel scrolling for views |
| 171 // is enabled. See crbug.com/329354. | 172 // is enabled. See crbug.com/329354. |
| 172 gfx::Vector2dF roundoff_error_; | 173 gfx::Vector2dF roundoff_error_; |
| 173 | 174 |
| 174 DISALLOW_COPY_AND_ASSIGN(BaseScrollBar); | 175 DISALLOW_COPY_AND_ASSIGN(BaseScrollBar); |
| 175 }; | 176 }; |
| 176 | 177 |
| 177 } // namespace views | 178 } // namespace views |
| 178 | 179 |
| 179 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_H_ | 180 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_H_ |
| OLD | NEW |