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_CUSTOM_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
6 #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 void OnBlur() override; | 135 void OnBlur() override; |
136 | 136 |
137 protected: | 137 protected: |
138 // Construct the Button with a Listener. See comment for Button's ctor. | 138 // Construct the Button with a Listener. See comment for Button's ctor. |
139 explicit CustomButton(ButtonListener* listener); | 139 explicit CustomButton(ButtonListener* listener); |
140 | 140 |
141 // Invoked from SetState() when SetState() is passed a value that differs from | 141 // Invoked from SetState() when SetState() is passed a value that differs from |
142 // the current node_data. CustomButton's implementation of StateChanged() does | 142 // the current node_data. CustomButton's implementation of StateChanged() does |
143 // nothing; this method is provided for subclasses that wish to do something | 143 // nothing; this method is provided for subclasses that wish to do something |
144 // on state changes. | 144 // on state changes. |
145 virtual void StateChanged(); | 145 virtual void StateChanged(ButtonState old_state); |
146 | 146 |
147 // Returns true if the event is one that can trigger notifying the listener. | 147 // Returns true if the event is one that can trigger notifying the listener. |
148 // This implementation returns true if the left mouse button is down. | 148 // This implementation returns true if the left mouse button is down. |
149 virtual bool IsTriggerableEvent(const ui::Event& event); | 149 virtual bool IsTriggerableEvent(const ui::Event& event); |
150 | 150 |
151 // Returns true if the button should become pressed when the user | 151 // Returns true if the button should become pressed when the user |
152 // holds the mouse down over the button. For this implementation, | 152 // holds the mouse down over the button. For this implementation, |
153 // we simply return IsTriggerableEvent(event). | 153 // we simply return IsTriggerableEvent(event). |
154 virtual bool ShouldEnterPushedState(const ui::Event& event); | 154 virtual bool ShouldEnterPushedState(const ui::Event& event); |
155 | 155 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 // The color of the ripple and hover. | 202 // The color of the ripple and hover. |
203 SkColor ink_drop_base_color_; | 203 SkColor ink_drop_base_color_; |
204 | 204 |
205 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 205 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
206 }; | 206 }; |
207 | 207 |
208 } // namespace views | 208 } // namespace views |
209 | 209 |
210 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 210 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
OLD | NEW |