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

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

Issue 329813003: Reland: Use labels to display views tab titles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Call AddChildView(title_) on Tab to prevent leaks. Created 6 years, 6 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/message_center/views/bounded_label.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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 label_->SetFontList( 121 label_->SetFontList(
122 style_ == STYLE_BUTTON && is_default_ ? 122 style_ == STYLE_BUTTON && is_default_ ?
123 cached_bold_font_list_ : cached_normal_font_list_); 123 cached_bold_font_list_ : cached_normal_font_list_);
124 } 124 }
125 125
126 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) { 126 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
127 label_->SetElideBehavior(elide_behavior); 127 label_->SetElideBehavior(elide_behavior);
128 } 128 }
129 129
130 gfx::HorizontalAlignment LabelButton::GetHorizontalAlignment() const { 130 gfx::HorizontalAlignment LabelButton::GetHorizontalAlignment() const {
131 return label_->horizontal_alignment(); 131 return label_->GetHorizontalAlignment();
132 } 132 }
133 133
134 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) { 134 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) {
135 label_->SetHorizontalAlignment(alignment); 135 label_->SetHorizontalAlignment(alignment);
136 InvalidateLayout(); 136 InvalidateLayout();
137 } 137 }
138 138
139 void LabelButton::SetIsDefault(bool is_default) { 139 void LabelButton::SetIsDefault(bool is_default) {
140 if (is_default == is_default_) 140 if (is_default == is_default_)
141 return; 141 return;
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 return ui::NativeTheme::kNormal; 429 return ui::NativeTheme::kNormal;
430 } 430 }
431 431
432 ui::NativeTheme::State LabelButton::GetForegroundThemeState( 432 ui::NativeTheme::State LabelButton::GetForegroundThemeState(
433 ui::NativeTheme::ExtraParams* params) const { 433 ui::NativeTheme::ExtraParams* params) const {
434 GetExtraParams(params); 434 GetExtraParams(params);
435 return ui::NativeTheme::kHovered; 435 return ui::NativeTheme::kHovered;
436 } 436 }
437 437
438 } // namespace views 438 } // namespace views
OLDNEW
« no previous file with comments | « ui/message_center/views/bounded_label.cc ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698