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

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

Issue 1870573003: Full Keyboard Access: Second Approach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/image_button.h ('k') | ui/views/controls/button/md_text_button.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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 // All callers currently pass STYLE_BUTTON, and should only call this once, to 207 // All callers currently pass STYLE_BUTTON, and should only call this once, to
208 // change from the default style. 208 // change from the default style.
209 DCHECK_EQ(style, STYLE_BUTTON); 209 DCHECK_EQ(style, STYLE_BUTTON);
210 DCHECK_EQ(style_, STYLE_TEXTBUTTON); 210 DCHECK_EQ(style_, STYLE_TEXTBUTTON);
211 DCHECK(!GetWidget()) << "Can't change button style after adding to a Widget."; 211 DCHECK(!GetWidget()) << "Can't change button style after adding to a Widget.";
212 212
213 style_ = style; 213 style_ = style;
214 214
215 SetFocusPainter(nullptr); 215 SetFocusPainter(nullptr);
216 SetHorizontalAlignment(gfx::ALIGN_CENTER); 216 SetHorizontalAlignment(gfx::ALIGN_CENTER);
217 SetFocusable(true); 217 PlatformStyle::ConfigureFocus(PlatformStyle::CONTROL::BUTTON, this);
218
218 SetMinSize(gfx::Size(70, 33)); 219 SetMinSize(gfx::Size(70, 33));
219 220
220 // Themed borders will be set once the button is added to a Widget, since that 221 // Themed borders will be set once the button is added to a Widget, since that
221 // provides the value of GetNativeTheme(). 222 // provides the value of GetNativeTheme().
222 } 223 }
223 224
224 void LabelButton::SetImageLabelSpacing(int spacing) { 225 void LabelButton::SetImageLabelSpacing(int spacing) {
225 if (spacing == image_label_spacing_) 226 if (spacing == image_label_spacing_)
226 return; 227 return;
227 image_label_spacing_ = spacing; 228 image_label_spacing_ = spacing;
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 GetExtraParams(params); 568 GetExtraParams(params);
568 return ui::NativeTheme::kHovered; 569 return ui::NativeTheme::kHovered;
569 } 570 }
570 571
571 void LabelButton::ResetCachedPreferredSize() { 572 void LabelButton::ResetCachedPreferredSize() {
572 cached_preferred_size_valid_ = false; 573 cached_preferred_size_valid_ = false;
573 cached_preferred_size_ = gfx::Size(); 574 cached_preferred_size_ = gfx::Size();
574 } 575 }
575 576
576 } // namespace views 577 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/image_button.h ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698