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_SCROLL_VIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ |
6 #define UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Returns the horizontal/vertical scrollbar. This may return NULL. | 68 // Returns the horizontal/vertical scrollbar. This may return NULL. |
69 const ScrollBar* horizontal_scroll_bar() const { return horiz_sb_; } | 69 const ScrollBar* horizontal_scroll_bar() const { return horiz_sb_; } |
70 const ScrollBar* vertical_scroll_bar() const { return vert_sb_; } | 70 const ScrollBar* vertical_scroll_bar() const { return vert_sb_; } |
71 | 71 |
72 // Customize the scrollbar design. ScrollView takes the ownership of the | 72 // Customize the scrollbar design. ScrollView takes the ownership of the |
73 // specified ScrollBar. |horiz_sb| and |vert_sb| cannot be NULL. | 73 // specified ScrollBar. |horiz_sb| and |vert_sb| cannot be NULL. |
74 void SetHorizontalScrollBar(ScrollBar* horiz_sb); | 74 void SetHorizontalScrollBar(ScrollBar* horiz_sb); |
75 void SetVerticalScrollBar(ScrollBar* vert_sb); | 75 void SetVerticalScrollBar(ScrollBar* vert_sb); |
76 | 76 |
77 // View overrides: | 77 // View overrides: |
78 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 78 virtual gfx::Size GetPreferredSize() const override; |
79 virtual int GetHeightForWidth(int width) const OVERRIDE; | 79 virtual int GetHeightForWidth(int width) const override; |
80 virtual void Layout() OVERRIDE; | 80 virtual void Layout() override; |
81 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 81 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; |
82 virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) OVERRIDE; | 82 virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) override; |
83 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 83 virtual void OnMouseEntered(const ui::MouseEvent& event) override; |
84 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 84 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
85 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 85 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
86 virtual const char* GetClassName() const OVERRIDE; | 86 virtual const char* GetClassName() const override; |
87 | 87 |
88 // ScrollBarController overrides: | 88 // ScrollBarController overrides: |
89 virtual void ScrollToPosition(ScrollBar* source, int position) OVERRIDE; | 89 virtual void ScrollToPosition(ScrollBar* source, int position) override; |
90 virtual int GetScrollIncrement(ScrollBar* source, | 90 virtual int GetScrollIncrement(ScrollBar* source, |
91 bool is_page, | 91 bool is_page, |
92 bool is_positive) OVERRIDE; | 92 bool is_positive) override; |
93 | 93 |
94 private: | 94 private: |
95 FRIEND_TEST_ALL_PREFIXES(ScrollViewTest, CornerViewVisibility); | 95 FRIEND_TEST_ALL_PREFIXES(ScrollViewTest, CornerViewVisibility); |
96 class Viewport; | 96 class Viewport; |
97 | 97 |
98 // Used internally by SetHeader() and SetContents() to reset the view. Sets | 98 // Used internally by SetHeader() and SetContents() to reset the view. Sets |
99 // |member| to |new_view|. If |new_view| is non-null it is added to |parent|. | 99 // |member| to |new_view|. If |new_view| is non-null it is added to |parent|. |
100 void SetHeaderOrContents(View* parent, View* new_view, View** member); | 100 void SetHeaderOrContents(View* parent, View* new_view, View** member); |
101 | 101 |
102 // Scrolls the minimum amount necessary to make the specified rectangle | 102 // Scrolls the minimum amount necessary to make the specified rectangle |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // GetPageScrollIncrement and GetLineScrollIncrement to it. | 204 // GetPageScrollIncrement and GetLineScrollIncrement to it. |
205 class FixedRowHeightScrollHelper : public VariableRowHeightScrollHelper { | 205 class FixedRowHeightScrollHelper : public VariableRowHeightScrollHelper { |
206 public: | 206 public: |
207 // Creates a FixedRowHeightScrollHelper. top_margin gives the distance from | 207 // Creates a FixedRowHeightScrollHelper. top_margin gives the distance from |
208 // the top of the view to the first row, and may be 0. row_height gives the | 208 // the top of the view to the first row, and may be 0. row_height gives the |
209 // height of each row. | 209 // height of each row. |
210 FixedRowHeightScrollHelper(int top_margin, int row_height); | 210 FixedRowHeightScrollHelper(int top_margin, int row_height); |
211 | 211 |
212 protected: | 212 protected: |
213 // Calculates the bounds of the row from the top margin and row height. | 213 // Calculates the bounds of the row from the top margin and row height. |
214 virtual RowInfo GetRowInfo(int y) OVERRIDE; | 214 virtual RowInfo GetRowInfo(int y) override; |
215 | 215 |
216 private: | 216 private: |
217 int top_margin_; | 217 int top_margin_; |
218 int row_height_; | 218 int row_height_; |
219 | 219 |
220 DISALLOW_COPY_AND_ASSIGN(FixedRowHeightScrollHelper); | 220 DISALLOW_COPY_AND_ASSIGN(FixedRowHeightScrollHelper); |
221 }; | 221 }; |
222 | 222 |
223 } // namespace views | 223 } // namespace views |
224 | 224 |
225 #endif // UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ | 225 #endif // UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ |
OLD | NEW |