| 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 "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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 404 |
| 405 void TextButtonBase::OnPaint(gfx::Canvas* canvas) { | 405 void TextButtonBase::OnPaint(gfx::Canvas* canvas) { |
| 406 PaintButton(canvas, PB_NORMAL); | 406 PaintButton(canvas, PB_NORMAL); |
| 407 } | 407 } |
| 408 | 408 |
| 409 const ui::Animation* TextButtonBase::GetAnimation() const { | 409 const ui::Animation* TextButtonBase::GetAnimation() const { |
| 410 return hover_animation_.get(); | 410 return hover_animation_.get(); |
| 411 } | 411 } |
| 412 | 412 |
| 413 void TextButtonBase::UpdateColor() { | 413 void TextButtonBase::UpdateColor() { |
| 414 color_ = View::IsEnabled() ? color_enabled_ : color_disabled_; | 414 color_ = enabled() ? color_enabled_ : color_disabled_; |
| 415 } | 415 } |
| 416 | 416 |
| 417 void TextButtonBase::UpdateTextSize() { | 417 void TextButtonBase::UpdateTextSize() { |
| 418 CalculateTextSize(&text_size_, width()); | 418 CalculateTextSize(&text_size_, width()); |
| 419 max_text_size_.SetSize(std::max(max_text_size_.width(), text_size_.width()), | 419 max_text_size_.SetSize(std::max(max_text_size_.width(), text_size_.width()), |
| 420 std::max(max_text_size_.height(), | 420 std::max(max_text_size_.height(), |
| 421 text_size_.height())); | 421 text_size_.height())); |
| 422 PreferredSizeChanged(); | 422 PreferredSizeChanged(); |
| 423 } | 423 } |
| 424 | 424 |
| (...skipping 426 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 |