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

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

Issue 677563004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_THUMB_H_ 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_THUMB_H_
6 #define UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_THUMB_H_ 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_THUMB_H_
7 7
8 #include "ui/gfx/size.h" 8 #include "ui/gfx/size.h"
9 #include "ui/views/controls/button/custom_button.h" 9 #include "ui/views/controls/button/custom_button.h"
10 #include "ui/views/controls/scrollbar/scroll_bar.h" 10 #include "ui/views/controls/scrollbar/scroll_bar.h"
(...skipping 11 matching lines...) Expand all
22 // 22 //
23 // BaseScrollBarThumb 23 // BaseScrollBarThumb
24 // 24 //
25 // A view that acts as the thumb in the scroll bar track that the user can 25 // A view that acts as the thumb in the scroll bar track that the user can
26 // drag to scroll the associated contents view within the viewport. 26 // drag to scroll the associated contents view within the viewport.
27 // 27 //
28 /////////////////////////////////////////////////////////////////////////////// 28 ///////////////////////////////////////////////////////////////////////////////
29 class VIEWS_EXPORT BaseScrollBarThumb : public View { 29 class VIEWS_EXPORT BaseScrollBarThumb : public View {
30 public: 30 public:
31 explicit BaseScrollBarThumb(BaseScrollBar* scroll_bar); 31 explicit BaseScrollBarThumb(BaseScrollBar* scroll_bar);
32 virtual ~BaseScrollBarThumb(); 32 ~BaseScrollBarThumb() override;
33 33
34 // Sets the size (width or height) of the thumb to the specified value. 34 // Sets the size (width or height) of the thumb to the specified value.
35 void SetSize(int size); 35 void SetSize(int size);
36 36
37 // Retrieves the size (width or height) of the thumb. 37 // Retrieves the size (width or height) of the thumb.
38 int GetSize() const; 38 int GetSize() const;
39 39
40 // Sets the position of the thumb on the x or y axis. 40 // Sets the position of the thumb on the x or y axis.
41 void SetPosition(int position); 41 void SetPosition(int position);
42 42
43 // Gets the position of the thumb on the x or y axis. 43 // Gets the position of the thumb on the x or y axis.
44 int GetPosition() const; 44 int GetPosition() const;
45 45
46 // View overrides: 46 // View overrides:
47 virtual gfx::Size GetPreferredSize() const override = 0; 47 virtual gfx::Size GetPreferredSize() const override = 0;
48 48
49 protected: 49 protected:
50 // View overrides: 50 // View overrides:
51 virtual void OnPaint(gfx::Canvas* canvas) override = 0; 51 virtual void OnPaint(gfx::Canvas* canvas) override = 0;
52 virtual void OnMouseEntered(const ui::MouseEvent& event) override; 52 void OnMouseEntered(const ui::MouseEvent& event) override;
53 virtual void OnMouseExited(const ui::MouseEvent& event) override; 53 void OnMouseExited(const ui::MouseEvent& event) override;
54 virtual bool OnMousePressed(const ui::MouseEvent& event) override; 54 bool OnMousePressed(const ui::MouseEvent& event) override;
55 virtual bool OnMouseDragged(const ui::MouseEvent& event) override; 55 bool OnMouseDragged(const ui::MouseEvent& event) override;
56 virtual void OnMouseReleased(const ui::MouseEvent& event) override; 56 void OnMouseReleased(const ui::MouseEvent& event) override;
57 virtual void OnMouseCaptureLost() override; 57 void OnMouseCaptureLost() override;
58 58
59 CustomButton::ButtonState GetState() const; 59 CustomButton::ButtonState GetState() const;
60 // Update our state and schedule a repaint when the mouse moves over us. 60 // Update our state and schedule a repaint when the mouse moves over us.
61 void SetState(CustomButton::ButtonState state); 61 void SetState(CustomButton::ButtonState state);
62 62
63 BaseScrollBar* scroll_bar() { return scroll_bar_; } 63 BaseScrollBar* scroll_bar() { return scroll_bar_; }
64 64
65 private: 65 private:
66 // The BaseScrollBar that owns us. 66 // The BaseScrollBar that owns us.
67 BaseScrollBar* scroll_bar_; 67 BaseScrollBar* scroll_bar_;
68 68
69 int drag_start_position_; 69 int drag_start_position_;
70 70
71 // The position of the mouse on the scroll axis relative to the top of this 71 // The position of the mouse on the scroll axis relative to the top of this
72 // View when the drag started. 72 // View when the drag started.
73 int mouse_offset_; 73 int mouse_offset_;
74 74
75 // The current state of the thumb button. 75 // The current state of the thumb button.
76 CustomButton::ButtonState state_; 76 CustomButton::ButtonState state_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(BaseScrollBarThumb); 78 DISALLOW_COPY_AND_ASSIGN(BaseScrollBarThumb);
79 }; 79 };
80 80
81 } // namespace views 81 } // namespace views
82 82
83 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_THUMB_H_ 83 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_THUMB_H_
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/base_scroll_bar_button.h ('k') | ui/views/controls/scrollbar/kennedy_scroll_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698