| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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. | 26 // The length of the hover fade animation. |
| 27 static const int kHoverAnimationDurationMs; | 27 static const int kHoverAnimationDurationMs; |
| 28 | 28 |
| 29 static const char kViewClassName[]; | 29 static const char kViewClassName[]; |
| 30 | 30 |
| 31 LabelButton(ButtonListener* listener, const string16& text); | 31 LabelButton(ButtonListener* listener, const base::string16& text); |
| 32 virtual ~LabelButton(); | 32 virtual ~LabelButton(); |
| 33 | 33 |
| 34 // Get or set the image shown for the specified button state. | 34 // Get or set the image shown for the specified button state. |
| 35 // 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. |
| 36 virtual const gfx::ImageSkia& GetImage(ButtonState for_state); | 36 virtual const gfx::ImageSkia& GetImage(ButtonState for_state); |
| 37 void SetImage(ButtonState for_state, const gfx::ImageSkia& image); | 37 void SetImage(ButtonState for_state, const gfx::ImageSkia& image); |
| 38 | 38 |
| 39 // Get or set the text shown on the button. | 39 // Get or set the text shown on the button. |
| 40 const string16& GetText() const; | 40 const base::string16& GetText() const; |
| 41 void SetText(const string16& text); | 41 void SetText(const base::string16& text); |
| 42 | 42 |
| 43 // Set the text color shown for the specified button state. | 43 // Set the text color shown for the specified button state. |
| 44 void SetTextColor(ButtonState for_state, SkColor color); | 44 void SetTextColor(ButtonState for_state, SkColor color); |
| 45 | 45 |
| 46 // Get or set the text's multi-line property to break on '\n', etc. | 46 // Get or set the text's multi-line property to break on '\n', etc. |
| 47 bool GetTextMultiLine() const; | 47 bool GetTextMultiLine() const; |
| 48 void SetTextMultiLine(bool text_multi_line); | 48 void SetTextMultiLine(bool text_multi_line); |
| 49 | 49 |
| 50 // Get or set the font used by this button. | 50 // Get or set the font used by this button. |
| 51 const gfx::Font& GetFont() const; | 51 const gfx::Font& GetFont() const; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 ButtonStyle style_; | 148 ButtonStyle style_; |
| 149 | 149 |
| 150 scoped_ptr<Painter> focus_painter_; | 150 scoped_ptr<Painter> focus_painter_; |
| 151 | 151 |
| 152 DISALLOW_COPY_AND_ASSIGN(LabelButton); | 152 DISALLOW_COPY_AND_ASSIGN(LabelButton); |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace views | 155 } // namespace views |
| 156 | 156 |
| 157 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 157 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| OLD | NEW |