| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 max_width_(0), | 200 max_width_(0), |
| 201 show_multiple_icon_states_(true), | 201 show_multiple_icon_states_(true), |
| 202 is_default_(false), | 202 is_default_(false), |
| 203 multi_line_(false), | 203 multi_line_(false), |
| 204 use_enabled_color_from_theme_(true), | 204 use_enabled_color_from_theme_(true), |
| 205 use_disabled_color_from_theme_(true), | 205 use_disabled_color_from_theme_(true), |
| 206 use_highlight_color_from_theme_(true), | 206 use_highlight_color_from_theme_(true), |
| 207 use_hover_color_from_theme_(true), | 207 use_hover_color_from_theme_(true), |
| 208 focus_painter_(Painter::CreateDashedFocusPainter()) { | 208 focus_painter_(Painter::CreateDashedFocusPainter()) { |
| 209 SetText(text); | 209 SetText(text); |
| 210 // OnNativeThemeChanged sets the color member variables. |
| 211 TextButtonBase::OnNativeThemeChanged(GetNativeTheme()); |
| 210 SetAnimationDuration(kHoverAnimationDurationMs); | 212 SetAnimationDuration(kHoverAnimationDurationMs); |
| 211 } | 213 } |
| 212 | 214 |
| 213 TextButtonBase::~TextButtonBase() { | 215 TextButtonBase::~TextButtonBase() { |
| 214 } | 216 } |
| 215 | 217 |
| 216 void TextButtonBase::SetIsDefault(bool is_default) { | 218 void TextButtonBase::SetIsDefault(bool is_default) { |
| 217 if (is_default == is_default_) | 219 if (is_default == is_default_) |
| 218 return; | 220 return; |
| 219 is_default_ = is_default; | 221 is_default_ = is_default; |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 if (show_multiple_icon_states_) { | 714 if (show_multiple_icon_states_) { |
| 713 if (has_hover_icon_ && (state() == STATE_HOVERED)) | 715 if (has_hover_icon_ && (state() == STATE_HOVERED)) |
| 714 return icon_hover_; | 716 return icon_hover_; |
| 715 if (has_pushed_icon_ && (state() == STATE_PRESSED)) | 717 if (has_pushed_icon_ && (state() == STATE_PRESSED)) |
| 716 return icon_pushed_; | 718 return icon_pushed_; |
| 717 } | 719 } |
| 718 return icon_; | 720 return icon_; |
| 719 } | 721 } |
| 720 | 722 |
| 721 } // namespace views | 723 } // namespace views |
| OLD | NEW |