| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| 6 #define VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| 7 | 7 |
| 8 #include "app/gfx/font.h" | 8 #include "app/gfx/font.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Sets the icon. | 87 // Sets the icon. |
| 88 void SetIcon(const SkBitmap& icon); | 88 void SetIcon(const SkBitmap& icon); |
| 89 SkBitmap icon() const { return icon_; } | 89 SkBitmap icon() const { return icon_; } |
| 90 | 90 |
| 91 // TextButton remembers the maximum display size of the text passed to | 91 // TextButton remembers the maximum display size of the text passed to |
| 92 // SetText. This method resets the cached maximum display size to the | 92 // SetText. This method resets the cached maximum display size to the |
| 93 // current size. | 93 // current size. |
| 94 void ClearMaxTextSize(); | 94 void ClearMaxTextSize(); |
| 95 | 95 |
| 96 void set_max_width(int max_width) { max_width_ = max_width; } | 96 void set_max_width(int max_width) { max_width_ = max_width; } |
| 97 void SetFont(const gfx::Font& font); |
| 97 void SetEnabledColor(SkColor color); | 98 void SetEnabledColor(SkColor color); |
| 98 void SetDisabledColor(SkColor color); | 99 void SetDisabledColor(SkColor color); |
| 99 void SetHighlightColor(SkColor color); | 100 void SetHighlightColor(SkColor color); |
| 100 | 101 |
| 101 // Paint the button into the specified canvas. If |for_drag| is true, the | 102 // Paint the button into the specified canvas. If |for_drag| is true, the |
| 102 // function paints a drag image representation into the canvas. | 103 // function paints a drag image representation into the canvas. |
| 103 virtual void Paint(gfx::Canvas* canvas, bool for_drag); | 104 virtual void Paint(gfx::Canvas* canvas, bool for_drag); |
| 104 | 105 |
| 105 // Overridden from View: | 106 // Overridden from View: |
| 106 virtual gfx::Size GetPreferredSize(); | 107 virtual gfx::Size GetPreferredSize(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // The width of the button will never be larger than this value. A value <= 0 | 152 // The width of the button will never be larger than this value. A value <= 0 |
| 152 // indicates the width is not constrained. | 153 // indicates the width is not constrained. |
| 153 int max_width_; | 154 int max_width_; |
| 154 | 155 |
| 155 DISALLOW_COPY_AND_ASSIGN(TextButton); | 156 DISALLOW_COPY_AND_ASSIGN(TextButton); |
| 156 }; | 157 }; |
| 157 | 158 |
| 158 } // namespace views | 159 } // namespace views |
| 159 | 160 |
| 160 #endif // VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 161 #endif // VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| OLD | NEW |