| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Set the elide behavior of this button. | 54 // Set the elide behavior of this button. |
| 55 void SetElideBehavior(Label::ElideBehavior elide_behavior); | 55 void SetElideBehavior(Label::ElideBehavior elide_behavior); |
| 56 | 56 |
| 57 // Get or set the horizontal alignment used for the button; reversed in RTL. | 57 // Get or set the horizontal alignment used for the button; reversed in RTL. |
| 58 // The optional image will lead the text, unless the button is right-aligned. | 58 // The optional image will lead the text, unless the button is right-aligned. |
| 59 gfx::HorizontalAlignment GetHorizontalAlignment() const; | 59 gfx::HorizontalAlignment GetHorizontalAlignment() const; |
| 60 void SetHorizontalAlignment(gfx::HorizontalAlignment alignment); | 60 void SetHorizontalAlignment(gfx::HorizontalAlignment alignment); |
| 61 | 61 |
| 62 // Call set_min_size(gfx::Size()) to clear the monotonically increasing size. | 62 // Call set_min_size(gfx::Size()) to clear the monotonically increasing size. |
| 63 void set_min_size(const gfx::Size& min_size) { min_size_ = min_size; } | 63 void set_min_size(const gfx::Size& min_size) { min_size_ = min_size; } |
| 64 void set_min_width(const int min_width) { min_size_.set_width(min_width); } | |
| 65 void set_max_size(const gfx::Size& max_size) { max_size_ = max_size; } | 64 void set_max_size(const gfx::Size& max_size) { max_size_ = max_size; } |
| 66 | 65 |
| 67 // Get or set the option to handle the return key; false by default. | 66 // Get or set the option to handle the return key; false by default. |
| 68 bool is_default() const { return is_default_; } | 67 bool is_default() const { return is_default_; } |
| 69 void SetIsDefault(bool is_default); | 68 void SetIsDefault(bool is_default); |
| 70 | 69 |
| 71 // Get or set the button's overall style; the default is |STYLE_TEXTBUTTON|. | 70 // Get or set the button's overall style; the default is |STYLE_TEXTBUTTON|. |
| 72 ButtonStyle style() const { return style_; } | 71 ButtonStyle style() const { return style_; } |
| 73 void SetStyle(ButtonStyle style); | 72 void SetStyle(ButtonStyle style); |
| 74 | 73 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 ButtonStyle style_; | 157 ButtonStyle style_; |
| 159 | 158 |
| 160 scoped_ptr<Painter> focus_painter_; | 159 scoped_ptr<Painter> focus_painter_; |
| 161 | 160 |
| 162 DISALLOW_COPY_AND_ASSIGN(LabelButton); | 161 DISALLOW_COPY_AND_ASSIGN(LabelButton); |
| 163 }; | 162 }; |
| 164 | 163 |
| 165 } // namespace views | 164 } // namespace views |
| 166 | 165 |
| 167 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 166 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| OLD | NEW |