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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 class LabelButtonBorder; | 24 class LabelButtonBorder; |
25 class Painter; | 25 class Painter; |
26 | 26 |
27 // LabelButton is a button with text and an icon, it's not focusable by default. | 27 // LabelButton is a button with text and an icon, it's not focusable by default. |
28 class VIEWS_EXPORT LabelButton : public CustomButton, | 28 class VIEWS_EXPORT LabelButton : public CustomButton, |
29 public NativeThemeDelegate { | 29 public NativeThemeDelegate { |
30 public: | 30 public: |
31 // The length of the hover fade animation. | 31 // The length of the hover fade animation. |
32 static const int kHoverAnimationDurationMs; | 32 static const int kHoverAnimationDurationMs; |
33 | 33 |
34 // Amount to inset each edge of the button when drawing the focus rectangle. | |
35 static const int kFocusRectInset; | |
36 | |
37 static const char kViewClassName[]; | 34 static const char kViewClassName[]; |
38 | 35 |
39 LabelButton(ButtonListener* listener, const base::string16& text); | 36 LabelButton(ButtonListener* listener, const base::string16& text); |
40 ~LabelButton() override; | 37 ~LabelButton() override; |
41 | 38 |
42 // Gets or sets the image shown for the specified button state. | 39 // Gets or sets the image shown for the specified button state. |
43 // GetImage returns the image for STATE_NORMAL if the state's image is empty. | 40 // GetImage returns the image for STATE_NORMAL if the state's image is empty. |
44 virtual gfx::ImageSkia GetImage(ButtonState for_state) const; | 41 virtual gfx::ImageSkia GetImage(ButtonState for_state) const; |
45 void SetImage(ButtonState for_state, const gfx::ImageSkia& image); | 42 void SetImage(ButtonState for_state, const gfx::ImageSkia& image); |
46 | 43 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 gfx::HorizontalAlignment horizontal_alignment_; | 231 gfx::HorizontalAlignment horizontal_alignment_; |
235 | 232 |
236 std::unique_ptr<Painter> focus_painter_; | 233 std::unique_ptr<Painter> focus_painter_; |
237 | 234 |
238 DISALLOW_COPY_AND_ASSIGN(LabelButton); | 235 DISALLOW_COPY_AND_ASSIGN(LabelButton); |
239 }; | 236 }; |
240 | 237 |
241 } // namespace views | 238 } // namespace views |
242 | 239 |
243 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 240 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
OLD | NEW |