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

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

Issue 63343004: Remove DialogDelegate::UseNewStyle and unused code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional cleanup; sync and rebase. Created 7 years, 1 month 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
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 if (style_ == STYLE_BUTTON) { 133 if (style_ == STYLE_BUTTON) {
134 int style = label_->font().GetStyle(); 134 int style = label_->font().GetStyle();
135 style = is_default ? style | gfx::Font::BOLD : style & ~gfx::Font::BOLD; 135 style = is_default ? style | gfx::Font::BOLD : style & ~gfx::Font::BOLD;
136 label_->SetFont(label_->font().DeriveFont(0, style)); 136 label_->SetFont(label_->font().DeriveFont(0, style));
137 } 137 }
138 } 138 }
139 139
140 void LabelButton::SetStyle(ButtonStyle style) { 140 void LabelButton::SetStyle(ButtonStyle style) {
141 // Use the new button style instead of the native button style. 141 // Use the new button style instead of the native button style.
142 // TODO(msw): Officialy deprecate and remove STYLE_NATIVE_TEXTBUTTON. 142 // TODO(msw): Officialy deprecate and remove STYLE_NATIVE_TEXTBUTTON.
143 if (DialogDelegate::UseNewStyle() && style == STYLE_NATIVE_TEXTBUTTON) 143 if (style == STYLE_NATIVE_TEXTBUTTON)
144 style = STYLE_BUTTON; 144 style = STYLE_BUTTON;
145 145
146 style_ = style; 146 style_ = style;
147 set_border(new LabelButtonBorder(style)); 147 set_border(new LabelButtonBorder(style));
148 // Inset the button focus rect from the actual border; roughly match Windows. 148 // Inset the button focus rect from the actual border; roughly match Windows.
149 set_focus_border(style == STYLE_BUTTON ? 149 set_focus_border(style == STYLE_BUTTON ?
150 NULL : FocusBorder::CreateDashedFocusBorder(3, 3, 3, 3)); 150 NULL : FocusBorder::CreateDashedFocusBorder(3, 3, 3, 3));
151 if (style == STYLE_BUTTON || style == STYLE_NATIVE_TEXTBUTTON) { 151 if (style == STYLE_BUTTON || style == STYLE_NATIVE_TEXTBUTTON) {
152 label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); 152 label_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
153 set_focusable(true); 153 set_focusable(true);
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 return ui::NativeTheme::kNormal; 366 return ui::NativeTheme::kNormal;
367 } 367 }
368 368
369 ui::NativeTheme::State LabelButton::GetForegroundThemeState( 369 ui::NativeTheme::State LabelButton::GetForegroundThemeState(
370 ui::NativeTheme::ExtraParams* params) const { 370 ui::NativeTheme::ExtraParams* params) const {
371 GetExtraParams(params); 371 GetExtraParams(params);
372 return ui::NativeTheme::kHovered; 372 return ui::NativeTheme::kHovered;
373 } 373 }
374 374
375 } // namespace views 375 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698