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_LABEL_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
11 #include "ui/gfx/font.h" | 11 #include "ui/gfx/font.h" |
12 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
13 #include "ui/views/controls/button/custom_button.h" | 13 #include "ui/views/controls/button/custom_button.h" |
14 #include "ui/views/controls/image_view.h" | 14 #include "ui/views/controls/image_view.h" |
15 #include "ui/views/controls/label.h" | 15 #include "ui/views/controls/label.h" |
16 #include "ui/views/native_theme_delegate.h" | 16 #include "ui/views/native_theme_delegate.h" |
17 | 17 |
18 namespace views { | 18 namespace views { |
19 | 19 |
20 class Painter; | 20 class Painter; |
21 | 21 |
22 // LabelButton is an alternative to TextButton, it's not focusable by default. | 22 // LabelButton is an alternative to TextButton, it's not focusable by default. |
23 class VIEWS_EXPORT LabelButton : public CustomButton, | 23 class VIEWS_EXPORT LabelButton : public CustomButton, |
24 public NativeThemeDelegate { | 24 public NativeThemeDelegate { |
25 public: | 25 public: |
| 26 // The length of the hover fade animation. |
| 27 static const int kHoverAnimationDurationMs; |
| 28 |
26 static const char kViewClassName[]; | 29 static const char kViewClassName[]; |
27 | 30 |
28 LabelButton(ButtonListener* listener, const string16& text); | 31 LabelButton(ButtonListener* listener, const string16& text); |
29 virtual ~LabelButton(); | 32 virtual ~LabelButton(); |
30 | 33 |
31 // Get or set the image shown for the specified button state. | 34 // Get or set the image shown for the specified button state. |
32 // GetImage returns the image for STATE_NORMAL if the state's image is empty. | 35 // GetImage returns the image for STATE_NORMAL if the state's image is empty. |
33 virtual const gfx::ImageSkia& GetImage(ButtonState for_state); | 36 virtual const gfx::ImageSkia& GetImage(ButtonState for_state); |
34 void SetImage(ButtonState for_state, const gfx::ImageSkia& image); | 37 void SetImage(ButtonState for_state, const gfx::ImageSkia& image); |
35 | 38 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 ButtonStyle style_; | 148 ButtonStyle style_; |
146 | 149 |
147 scoped_ptr<Painter> focus_painter_; | 150 scoped_ptr<Painter> focus_painter_; |
148 | 151 |
149 DISALLOW_COPY_AND_ASSIGN(LabelButton); | 152 DISALLOW_COPY_AND_ASSIGN(LabelButton); |
150 }; | 153 }; |
151 | 154 |
152 } // namespace views | 155 } // namespace views |
153 | 156 |
154 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 157 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
OLD | NEW |