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_BUTTON_MENU_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
6 #define UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 const gfx::ImageSkia* menu_marker() const { return menu_marker_; } | 59 const gfx::ImageSkia* menu_marker() const { return menu_marker_; } |
60 | 60 |
61 const gfx::Point& menu_offset() const { return menu_offset_; } | 61 const gfx::Point& menu_offset() const { return menu_offset_; } |
62 void set_menu_offset(int x, int y) { menu_offset_.SetPoint(x, y); } | 62 void set_menu_offset(int x, int y) { menu_offset_.SetPoint(x, y); } |
63 | 63 |
64 // Activate the button (called when the button is pressed). | 64 // Activate the button (called when the button is pressed). |
65 virtual bool Activate(); | 65 virtual bool Activate(); |
66 | 66 |
67 // Overridden from View: | 67 // Overridden from View: |
68 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 68 virtual gfx::Size GetPreferredSize() const override; |
69 virtual const char* GetClassName() const OVERRIDE; | 69 virtual const char* GetClassName() const override; |
70 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 70 virtual void OnPaint(gfx::Canvas* canvas) override; |
71 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 71 virtual bool OnMousePressed(const ui::MouseEvent& event) override; |
72 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 72 virtual void OnMouseReleased(const ui::MouseEvent& event) override; |
73 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 73 virtual void OnMouseEntered(const ui::MouseEvent& event) override; |
74 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 74 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
75 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 75 virtual void OnMouseMoved(const ui::MouseEvent& event) override; |
76 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 76 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
77 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 77 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; |
78 virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE; | 78 virtual bool OnKeyReleased(const ui::KeyEvent& event) override; |
79 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 79 virtual void GetAccessibleState(ui::AXViewState* state) override; |
80 | 80 |
81 protected: | 81 protected: |
82 // Paint the menu marker image. | 82 // Paint the menu marker image. |
83 void PaintMenuMarker(gfx::Canvas* canvas); | 83 void PaintMenuMarker(gfx::Canvas* canvas); |
84 | 84 |
85 // Overridden from LabelButton: | 85 // Overridden from LabelButton: |
86 virtual gfx::Rect GetChildAreaBounds() OVERRIDE; | 86 virtual gfx::Rect GetChildAreaBounds() override; |
87 | 87 |
88 // Offset of the associated menu position. | 88 // Offset of the associated menu position. |
89 gfx::Point menu_offset_; | 89 gfx::Point menu_offset_; |
90 | 90 |
91 private: | 91 private: |
92 friend class PressedLock; | 92 friend class PressedLock; |
93 | 93 |
94 // Increment/decrement the number of "pressed" locks this button has, and | 94 // Increment/decrement the number of "pressed" locks this button has, and |
95 // set the state accordingly. | 95 // set the state accordingly. |
96 void IncrementPressedLocked(); | 96 void IncrementPressedLocked(); |
(...skipping 28 matching lines...) Expand all Loading... |
125 int pressed_lock_count_; | 125 int pressed_lock_count_; |
126 | 126 |
127 base::WeakPtrFactory<MenuButton> weak_factory_; | 127 base::WeakPtrFactory<MenuButton> weak_factory_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(MenuButton); | 129 DISALLOW_COPY_AND_ASSIGN(MenuButton); |
130 }; | 130 }; |
131 | 131 |
132 } // namespace views | 132 } // namespace views |
133 | 133 |
134 #endif // UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 134 #endif // UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
OLD | NEW |