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 #include "ui/views/controls/button/label_button.h" | 5 #include "ui/views/controls/button/label_button.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 if (is_default == is_default_) | 189 if (is_default == is_default_) |
190 return; | 190 return; |
191 | 191 |
192 is_default_ = is_default; | 192 is_default_ = is_default; |
193 ui::Accelerator accel(ui::VKEY_RETURN, ui::EF_NONE); | 193 ui::Accelerator accel(ui::VKEY_RETURN, ui::EF_NONE); |
194 is_default_ ? AddAccelerator(accel) : RemoveAccelerator(accel); | 194 is_default_ ? AddAccelerator(accel) : RemoveAccelerator(accel); |
195 | 195 |
196 UpdateStyleToIndicateDefaultStatus(); | 196 UpdateStyleToIndicateDefaultStatus(); |
197 } | 197 } |
198 | 198 |
199 void LabelButton::SetStyle(ButtonStyle style) { | 199 void LabelButton::SetStyleDeprecated(ButtonStyle style) { |
200 // All callers currently pass STYLE_BUTTON, and should only call this once, to | 200 // All callers currently pass STYLE_BUTTON, and should only call this once, to |
201 // change from the default style. | 201 // change from the default style. |
202 DCHECK_EQ(style, STYLE_BUTTON); | 202 DCHECK_EQ(style, STYLE_BUTTON); |
203 DCHECK_EQ(style_, STYLE_TEXTBUTTON); | 203 DCHECK_EQ(style_, STYLE_TEXTBUTTON); |
204 DCHECK(!GetWidget()) << "Can't change button style after adding to a Widget."; | 204 DCHECK(!GetWidget()) << "Can't change button style after adding to a Widget."; |
205 | 205 |
206 style_ = style; | 206 style_ = style; |
207 | 207 |
208 SetFocusPainter(nullptr); | 208 SetFocusPainter(nullptr); |
209 SetHorizontalAlignment(gfx::ALIGN_CENTER); | 209 SetHorizontalAlignment(gfx::ALIGN_CENTER); |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 : PlatformStyle::TextColorForButton(button_state_colors_, *this); | 603 : PlatformStyle::TextColorForButton(button_state_colors_, *this); |
604 if (state() != STATE_DISABLED && label_->enabled_color() != color) | 604 if (state() != STATE_DISABLED && label_->enabled_color() != color) |
605 label_->SetEnabledColor(color); | 605 label_->SetEnabledColor(color); |
606 } | 606 } |
607 | 607 |
608 bool LabelButton::UseFloodFillInkDrop() const { | 608 bool LabelButton::UseFloodFillInkDrop() const { |
609 return !GetText().empty(); | 609 return !GetText().empty(); |
610 } | 610 } |
611 | 611 |
612 } // namespace views | 612 } // namespace views |
OLD | NEW |