| 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_TEXT_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const string16& text() const { return text_; } | 135 const string16& text() const { return text_; } |
| 136 | 136 |
| 137 enum TextAlignment { | 137 enum TextAlignment { |
| 138 ALIGN_LEFT, | 138 ALIGN_LEFT, |
| 139 ALIGN_CENTER, | 139 ALIGN_CENTER, |
| 140 ALIGN_RIGHT | 140 ALIGN_RIGHT |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 void set_alignment(TextAlignment alignment) { alignment_ = alignment; } | 143 void set_alignment(TextAlignment alignment) { alignment_ = alignment; } |
| 144 | 144 |
| 145 const ui::Animation* GetAnimation() const; | 145 const gfx::Animation* GetAnimation() const; |
| 146 | 146 |
| 147 void SetIsDefault(bool is_default); | 147 void SetIsDefault(bool is_default); |
| 148 bool is_default() const { return is_default_; } | 148 bool is_default() const { return is_default_; } |
| 149 | 149 |
| 150 // Set whether the button text can wrap on multiple lines. | 150 // Set whether the button text can wrap on multiple lines. |
| 151 // Default is false. | 151 // Default is false. |
| 152 void SetMultiLine(bool multi_line); | 152 void SetMultiLine(bool multi_line); |
| 153 | 153 |
| 154 // Return whether the button text can wrap on multiple lines. | 154 // Return whether the button text can wrap on multiple lines. |
| 155 bool multi_line() const { return multi_line_; } | 155 bool multi_line() const { return multi_line_; } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 227 } |
| 228 | 228 |
| 229 bool use_hover_color_from_theme() const { | 229 bool use_hover_color_from_theme() const { |
| 230 return use_hover_color_from_theme_; | 230 return use_hover_color_from_theme_; |
| 231 } | 231 } |
| 232 | 232 |
| 233 // Overridden from NativeThemeDelegate: | 233 // Overridden from NativeThemeDelegate: |
| 234 virtual gfx::Rect GetThemePaintRect() const OVERRIDE; | 234 virtual gfx::Rect GetThemePaintRect() const OVERRIDE; |
| 235 virtual ui::NativeTheme::State GetThemeState( | 235 virtual ui::NativeTheme::State GetThemeState( |
| 236 ui::NativeTheme::ExtraParams* params) const OVERRIDE; | 236 ui::NativeTheme::ExtraParams* params) const OVERRIDE; |
| 237 virtual const ui::Animation* GetThemeAnimation() const OVERRIDE; | 237 virtual const gfx::Animation* GetThemeAnimation() const OVERRIDE; |
| 238 virtual ui::NativeTheme::State GetBackgroundThemeState( | 238 virtual ui::NativeTheme::State GetBackgroundThemeState( |
| 239 ui::NativeTheme::ExtraParams* params) const OVERRIDE; | 239 ui::NativeTheme::ExtraParams* params) const OVERRIDE; |
| 240 virtual ui::NativeTheme::State GetForegroundThemeState( | 240 virtual ui::NativeTheme::State GetForegroundThemeState( |
| 241 ui::NativeTheme::ExtraParams* params) const OVERRIDE; | 241 ui::NativeTheme::ExtraParams* params) const OVERRIDE; |
| 242 | 242 |
| 243 virtual void GetExtraParams(ui::NativeTheme::ExtraParams* params) const; | 243 virtual void GetExtraParams(ui::NativeTheme::ExtraParams* params) const; |
| 244 | 244 |
| 245 virtual gfx::Rect GetTextBounds() const; | 245 virtual gfx::Rect GetTextBounds() const; |
| 246 | 246 |
| 247 int ComputeCanvasStringFlags() const; | 247 int ComputeCanvasStringFlags() const; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 // True if the button should ignore the minimum size for the platform. Default | 396 // True if the button should ignore the minimum size for the platform. Default |
| 397 // is true. Set to false to prevent narrower buttons. | 397 // is true. Set to false to prevent narrower buttons. |
| 398 bool ignore_minimum_size_; | 398 bool ignore_minimum_size_; |
| 399 | 399 |
| 400 DISALLOW_COPY_AND_ASSIGN(TextButton); | 400 DISALLOW_COPY_AND_ASSIGN(TextButton); |
| 401 }; | 401 }; |
| 402 | 402 |
| 403 } // namespace views | 403 } // namespace views |
| 404 | 404 |
| 405 #endif // UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 405 #endif // UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| OLD | NEW |