| 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 "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/gfx/font.h" | 10 #include "ui/gfx/font.h" |
| 11 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
| 12 #include "ui/views/controls/button/custom_button.h" | 12 #include "ui/views/controls/button/custom_button.h" |
| 13 #include "ui/views/controls/image_view.h" | 13 #include "ui/views/controls/image_view.h" |
| 14 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
| 15 #include "ui/views/native_theme_delegate.h" | 15 #include "ui/views/native_theme_delegate.h" |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 | 18 |
| 19 // LabelButton is an alternative to TextButton, it's not focusable by default. | 19 // LabelButton is an alternative to TextButton, it's not focusable by default. |
| 20 class VIEWS_EXPORT LabelButton : public CustomButton, | 20 class VIEWS_EXPORT LabelButton : public CustomButton, |
| 21 public NativeThemeDelegate { | 21 public NativeThemeDelegate { |
| 22 public: | 22 public: |
| 23 // The length of the hover fade animation. |
| 24 static const int kHoverAnimationDurationMs; |
| 25 |
| 23 static const char kViewClassName[]; | 26 static const char kViewClassName[]; |
| 24 | 27 |
| 25 LabelButton(ButtonListener* listener, const string16& text); | 28 LabelButton(ButtonListener* listener, const string16& text); |
| 26 virtual ~LabelButton(); | 29 virtual ~LabelButton(); |
| 27 | 30 |
| 28 // Get or set the image shown for the specified button state. | 31 // Get or set the image shown for the specified button state. |
| 29 // GetImage returns the image for STATE_NORMAL if the state's image is empty. | 32 // GetImage returns the image for STATE_NORMAL if the state's image is empty. |
| 30 virtual const gfx::ImageSkia& GetImage(ButtonState for_state); | 33 virtual const gfx::ImageSkia& GetImage(ButtonState for_state); |
| 31 void SetImage(ButtonState for_state, const gfx::ImageSkia& image); | 34 void SetImage(ButtonState for_state, const gfx::ImageSkia& image); |
| 32 | 35 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 136 |
| 134 // The button's overall style. | 137 // The button's overall style. |
| 135 ButtonStyle style_; | 138 ButtonStyle style_; |
| 136 | 139 |
| 137 DISALLOW_COPY_AND_ASSIGN(LabelButton); | 140 DISALLOW_COPY_AND_ASSIGN(LabelButton); |
| 138 }; | 141 }; |
| 139 | 142 |
| 140 } // namespace views | 143 } // namespace views |
| 141 | 144 |
| 142 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 145 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| OLD | NEW |