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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
11 #include "ui/gfx/animation/animation_delegate.h" | 11 #include "ui/gfx/animation/animation_delegate.h" |
12 #include "ui/gfx/animation/throb_animation.h" | 12 #include "ui/gfx/animation/throb_animation.h" |
13 #include "ui/views/animation/ink_drop_state.h" | 13 #include "ui/views/animation/ink_drop_state.h" |
14 #include "ui/views/controls/button/button.h" | 14 #include "ui/views/controls/button/button.h" |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 | 17 |
18 class InkDropDelegate; | 18 class InkDropDelegate; |
19 | 19 |
20 // A button with custom rendering. The base of ImageButton and LabelButton. | 20 // A button with custom rendering. The base of ImageButton and LabelButton. |
21 // Note that this type of button is not focusable by default and will not be | 21 // Note that this type of button is not focusable by default and will not be |
22 // part of the focus chain. Call SetFocusable(true) to make it part of the | 22 // part of the focus chain, unless in accessibility mode. Call |
23 // focus chain. | 23 // SetFocusBehavior(CONTROL) to make it part of the focus chain. |
24 class VIEWS_EXPORT CustomButton : public Button, public gfx::AnimationDelegate { | 24 class VIEWS_EXPORT CustomButton : public Button, public gfx::AnimationDelegate { |
25 public: | 25 public: |
26 // An enum describing the events on which a button should notify its listener. | 26 // An enum describing the events on which a button should notify its listener. |
27 enum NotifyAction { | 27 enum NotifyAction { |
28 NOTIFY_ON_PRESS, | 28 NOTIFY_ON_PRESS, |
29 NOTIFY_ON_RELEASE, | 29 NOTIFY_ON_RELEASE, |
30 }; | 30 }; |
31 | 31 |
32 // The menu button's class name. | 32 // The menu button's class name. |
33 static const char kViewClassName[]; | 33 static const char kViewClassName[]; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 // The color of the ripple and hover. | 191 // The color of the ripple and hover. |
192 SkColor ink_drop_base_color_; | 192 SkColor ink_drop_base_color_; |
193 | 193 |
194 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 194 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
195 }; | 195 }; |
196 | 196 |
197 } // namespace views | 197 } // namespace views |
198 | 198 |
199 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 199 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
OLD | NEW |