| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/animation/throb_animation.h" | 10 #include "ui/gfx/animation/throb_animation.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 label_->SetFontList( | 129 label_->SetFontList( |
| 130 style_ == STYLE_BUTTON && is_default_ ? | 130 style_ == STYLE_BUTTON && is_default_ ? |
| 131 cached_bold_font_list_ : cached_normal_font_list_); | 131 cached_bold_font_list_ : cached_normal_font_list_); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) { | 134 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) { |
| 135 label_->SetElideBehavior(elide_behavior); | 135 label_->SetElideBehavior(elide_behavior); |
| 136 } | 136 } |
| 137 | 137 |
| 138 gfx::HorizontalAlignment LabelButton::GetHorizontalAlignment() const { | 138 gfx::HorizontalAlignment LabelButton::GetHorizontalAlignment() const { |
| 139 return label_->GetHorizontalAlignment(); | 139 return label_->horizontal_alignment(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) { | 142 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) { |
| 143 label_->SetHorizontalAlignment(alignment); | 143 label_->SetHorizontalAlignment(alignment); |
| 144 InvalidateLayout(); | 144 InvalidateLayout(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void LabelButton::SetIsDefault(bool is_default) { | 147 void LabelButton::SetIsDefault(bool is_default) { |
| 148 if (is_default == is_default_) | 148 if (is_default == is_default_) |
| 149 return; | 149 return; |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 return ui::NativeTheme::kNormal; | 452 return ui::NativeTheme::kNormal; |
| 453 } | 453 } |
| 454 | 454 |
| 455 ui::NativeTheme::State LabelButton::GetForegroundThemeState( | 455 ui::NativeTheme::State LabelButton::GetForegroundThemeState( |
| 456 ui::NativeTheme::ExtraParams* params) const { | 456 ui::NativeTheme::ExtraParams* params) const { |
| 457 GetExtraParams(params); | 457 GetExtraParams(params); |
| 458 return ui::NativeTheme::kHovered; | 458 return ui::NativeTheme::kHovered; |
| 459 } | 459 } |
| 460 | 460 |
| 461 } // namespace views | 461 } // namespace views |
| OLD | NEW |