Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: ui/views/controls/button/label_button.cc

Issue 413823002: Cache gfx::RenderText instances in views::Label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/app_list_item_view.cc ('k') | ui/views/controls/label.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_item_view.cc ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698