OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/button/text_button.h" | 5 #include "views/controls/button/text_button.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 | 298 |
299 TextButtonBase::~TextButtonBase() { | 299 TextButtonBase::~TextButtonBase() { |
300 } | 300 } |
301 | 301 |
302 void TextButtonBase::SetIsDefault(bool is_default) { | 302 void TextButtonBase::SetIsDefault(bool is_default) { |
303 if (is_default == is_default_) | 303 if (is_default == is_default_) |
304 return; | 304 return; |
305 is_default_ = is_default; | 305 is_default_ = is_default; |
306 if (is_default_) | 306 if (is_default_) |
307 AddAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false)); | 307 AddAccelerator(ui::Accelerator(ui::VKEY_RETURN, false, false, false)); |
308 else | 308 else |
309 RemoveAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false)); | 309 RemoveAccelerator(ui::Accelerator(ui::VKEY_RETURN, false, false, false)); |
310 SchedulePaint(); | 310 SchedulePaint(); |
311 } | 311 } |
312 | 312 |
313 void TextButtonBase::SetText(const string16& text) { | 313 void TextButtonBase::SetText(const string16& text) { |
314 text_ = text; | 314 text_ = text; |
315 SetAccessibleName(text); | 315 SetAccessibleName(text); |
316 UpdateTextSize(); | 316 UpdateTextSize(); |
317 } | 317 } |
318 | 318 |
319 void TextButtonBase::SetFont(const gfx::Font& font) { | 319 void TextButtonBase::SetFont(const gfx::Font& font) { |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 #endif | 851 #endif |
852 } | 852 } |
853 | 853 |
854 void NativeTextButton::GetExtraParams( | 854 void NativeTextButton::GetExtraParams( |
855 gfx::NativeTheme::ExtraParams* params) const { | 855 gfx::NativeTheme::ExtraParams* params) const { |
856 TextButton::GetExtraParams(params); | 856 TextButton::GetExtraParams(params); |
857 params->button.has_border = true; | 857 params->button.has_border = true; |
858 } | 858 } |
859 | 859 |
860 } // namespace views | 860 } // namespace views |
OLD | NEW |