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

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

Issue 2496643002: Implement Sebastien's overlay scrollbars for native UI (Views). (Closed)
Patch Set: 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 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 #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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 CustomButton::ButtonState GetThumbTrackState() const; 104 CustomButton::ButtonState GetThumbTrackState() const;
105 105
106 // Wrapper functions that calls the controller. We need this since native 106 // Wrapper functions that calls the controller. We need this since native
107 // scrollbars wrap around a different scrollbar. When calling the controller 107 // scrollbars wrap around a different scrollbar. When calling the controller
108 // we need to pass in the appropriate scrollbar. For normal scrollbars it's 108 // we need to pass in the appropriate scrollbar. For normal scrollbars it's
109 // the |this| scrollbar, for native scrollbars it's the native scrollbar used 109 // the |this| scrollbar, for native scrollbars it's the native scrollbar used
110 // to create this. 110 // to create this.
111 virtual void ScrollToPosition(int position); 111 virtual void ScrollToPosition(int position);
112 virtual int GetScrollIncrement(bool is_page, bool is_positive); 112 virtual int GetScrollIncrement(bool is_page, bool is_positive);
113 113
114 int contents_size() const { return contents_size_; }
115 int contents_scroll_offset() const { return contents_scroll_offset_; }
116 int viewport_size() const { return viewport_size_; }
117
114 private: 118 private:
115 friend class test::ScrollViewTestApi; 119 friend class test::ScrollViewTestApi;
116 120
117 FRIEND_TEST_ALL_PREFIXES(ScrollBarViewsTest, ScrollBarFitsToBottom); 121 FRIEND_TEST_ALL_PREFIXES(ScrollBarViewsTest, ScrollBarFitsToBottom);
118 FRIEND_TEST_ALL_PREFIXES(ScrollBarViewsTest, ThumbFullLengthOfTrack); 122 FRIEND_TEST_ALL_PREFIXES(ScrollBarViewsTest, ThumbFullLengthOfTrack);
119 int GetThumbSizeForTest(); 123 int GetThumbSizeForTest();
120 124
121 // Changes to 'pushed' state and starts a timer to scroll repeatedly. 125 // Changes to 'pushed' state and starts a timer to scroll repeatedly.
122 void ProcessPressEvent(const ui::LocatedEvent& event); 126 void ProcessPressEvent(const ui::LocatedEvent& event);
123 127
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // TODO(tdresser): This should be removed when raw pixel scrolling for views 189 // TODO(tdresser): This should be removed when raw pixel scrolling for views
186 // is enabled. See crbug.com/329354. 190 // is enabled. See crbug.com/329354.
187 gfx::Vector2dF roundoff_error_; 191 gfx::Vector2dF roundoff_error_;
188 192
189 DISALLOW_COPY_AND_ASSIGN(BaseScrollBar); 193 DISALLOW_COPY_AND_ASSIGN(BaseScrollBar);
190 }; 194 };
191 195
192 } // namespace views 196 } // namespace views
193 197
194 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_H_ 198 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698