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

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

Issue 1963563002: Views: Flip default value of CustomButton::request_focus_on_press_ to false. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 7 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
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/examples/button_example.cc » ('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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // change from the default style. 209 // change from the default style.
210 DCHECK_EQ(style, STYLE_BUTTON); 210 DCHECK_EQ(style, STYLE_BUTTON);
211 DCHECK_EQ(style_, STYLE_TEXTBUTTON); 211 DCHECK_EQ(style_, STYLE_TEXTBUTTON);
212 DCHECK(!GetWidget()) << "Can't change button style after adding to a Widget."; 212 DCHECK(!GetWidget()) << "Can't change button style after adding to a Widget.";
213 213
214 style_ = style; 214 style_ = style;
215 215
216 SetFocusPainter(nullptr); 216 SetFocusPainter(nullptr);
217 SetHorizontalAlignment(gfx::ALIGN_CENTER); 217 SetHorizontalAlignment(gfx::ALIGN_CENTER);
218 Button::ConfigureDefaultFocus(this); 218 Button::ConfigureDefaultFocus(this);
219 set_request_focus_on_press(true);
219 SetMinSize(gfx::Size(PlatformStyle::kMinLabelButtonWidth, 220 SetMinSize(gfx::Size(PlatformStyle::kMinLabelButtonWidth,
220 PlatformStyle::kMinLabelButtonHeight)); 221 PlatformStyle::kMinLabelButtonHeight));
221 222
222 // Themed borders will be set once the button is added to a Widget, since that 223 // Themed borders will be set once the button is added to a Widget, since that
223 // provides the value of GetNativeTheme(). 224 // provides the value of GetNativeTheme().
224 } 225 }
225 226
226 void LabelButton::SetImageLabelSpacing(int spacing) { 227 void LabelButton::SetImageLabelSpacing(int spacing) {
227 if (spacing == image_label_spacing_) 228 if (spacing == image_label_spacing_)
228 return; 229 return;
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 void LabelButton::ResetLabelEnabledColor() { 568 void LabelButton::ResetLabelEnabledColor() {
568 const SkColor color = 569 const SkColor color =
569 explicitly_set_colors_[state()] 570 explicitly_set_colors_[state()]
570 ? button_state_colors_[state()] 571 ? button_state_colors_[state()]
571 : PlatformStyle::TextColorForButton(button_state_colors_, *this); 572 : PlatformStyle::TextColorForButton(button_state_colors_, *this);
572 if (state() != STATE_DISABLED && label_->enabled_color() != color) 573 if (state() != STATE_DISABLED && label_->enabled_color() != color)
573 label_->SetEnabledColor(color); 574 label_->SetEnabledColor(color);
574 } 575 }
575 576
576 } // namespace views 577 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/examples/button_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698