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/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ui/gfx/animation/throb_animation.h" | 9 #include "ui/gfx/animation/throb_animation.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 label_->SetFontList( | 149 label_->SetFontList( |
150 style_ == STYLE_BUTTON && is_default_ ? | 150 style_ == STYLE_BUTTON && is_default_ ? |
151 cached_bold_font_list_ : cached_normal_font_list_); | 151 cached_bold_font_list_ : cached_normal_font_list_); |
152 } | 152 } |
153 | 153 |
154 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) { | 154 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) { |
155 label_->SetElideBehavior(elide_behavior); | 155 label_->SetElideBehavior(elide_behavior); |
156 } | 156 } |
157 | 157 |
158 gfx::HorizontalAlignment LabelButton::GetHorizontalAlignment() const { | 158 gfx::HorizontalAlignment LabelButton::GetHorizontalAlignment() const { |
159 return label_->GetHorizontalAlignment(); | 159 return label_->horizontal_alignment(); |
160 } | 160 } |
161 | 161 |
162 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) { | 162 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) { |
163 label_->SetHorizontalAlignment(alignment); | 163 label_->SetHorizontalAlignment(alignment); |
164 InvalidateLayout(); | 164 InvalidateLayout(); |
165 } | 165 } |
166 | 166 |
167 void LabelButton::SetMinSize(const gfx::Size& min_size) { | 167 void LabelButton::SetMinSize(const gfx::Size& min_size) { |
168 min_size_ = min_size; | 168 min_size_ = min_size; |
169 ResetCachedPreferredSize(); | 169 ResetCachedPreferredSize(); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 GetExtraParams(params); | 516 GetExtraParams(params); |
517 return ui::NativeTheme::kHovered; | 517 return ui::NativeTheme::kHovered; |
518 } | 518 } |
519 | 519 |
520 void LabelButton::ResetCachedPreferredSize() { | 520 void LabelButton::ResetCachedPreferredSize() { |
521 cached_preferred_size_valid_ = false; | 521 cached_preferred_size_valid_ = false; |
522 cached_preferred_size_ = gfx::Size(); | 522 cached_preferred_size_ = gfx::Size(); |
523 } | 523 } |
524 | 524 |
525 } // namespace views | 525 } // namespace views |
OLD | NEW |