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/text_button.h" | 5 #include "ui/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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 text_ = text; | 244 text_ = text; |
245 SetAccessibleName(text); | 245 SetAccessibleName(text); |
246 UpdateTextSize(); | 246 UpdateTextSize(); |
247 } | 247 } |
248 | 248 |
249 void TextButtonBase::SetFontList(const gfx::FontList& font_list) { | 249 void TextButtonBase::SetFontList(const gfx::FontList& font_list) { |
250 font_list_ = font_list; | 250 font_list_ = font_list; |
251 UpdateTextSize(); | 251 UpdateTextSize(); |
252 } | 252 } |
253 | 253 |
254 const gfx::Font& TextButtonBase::font() const { | |
255 return font_list_.GetPrimaryFont(); | |
256 } | |
257 | |
258 void TextButtonBase::SetFont(const gfx::Font& font) { | |
259 SetFontList(gfx::FontList(font)); | |
260 } | |
261 | |
262 void TextButtonBase::SetEnabledColor(SkColor color) { | 254 void TextButtonBase::SetEnabledColor(SkColor color) { |
263 color_enabled_ = color; | 255 color_enabled_ = color; |
264 use_enabled_color_from_theme_ = false; | 256 use_enabled_color_from_theme_ = false; |
265 UpdateColor(); | 257 UpdateColor(); |
266 } | 258 } |
267 | 259 |
268 void TextButtonBase::SetDisabledColor(SkColor color) { | 260 void TextButtonBase::SetDisabledColor(SkColor color) { |
269 color_disabled_ = color; | 261 color_disabled_ = color; |
270 use_disabled_color_from_theme_ = false; | 262 use_disabled_color_from_theme_ = false; |
271 UpdateColor(); | 263 UpdateColor(); |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 if (show_multiple_icon_states_) { | 731 if (show_multiple_icon_states_) { |
740 if (has_hover_icon_ && (state() == STATE_HOVERED)) | 732 if (has_hover_icon_ && (state() == STATE_HOVERED)) |
741 return icon_hover_; | 733 return icon_hover_; |
742 if (has_pushed_icon_ && (state() == STATE_PRESSED)) | 734 if (has_pushed_icon_ && (state() == STATE_PRESSED)) |
743 return icon_pushed_; | 735 return icon_pushed_; |
744 } | 736 } |
745 return icon_; | 737 return icon_; |
746 } | 738 } |
747 | 739 |
748 } // namespace views | 740 } // namespace views |
OLD | NEW |