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

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

Issue 1817253003: [MD] Use same focus ring on BarControlButton as MdTextButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update docs Created 4 years, 9 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.cc ('k') | ui/views/controls/button/md_text_button.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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 gfx::Rect LabelButton::GetChildAreaBounds() { 375 gfx::Rect LabelButton::GetChildAreaBounds() {
376 return GetLocalBounds(); 376 return GetLocalBounds();
377 } 377 }
378 378
379 void LabelButton::OnPaint(gfx::Canvas* canvas) { 379 void LabelButton::OnPaint(gfx::Canvas* canvas) {
380 View::OnPaint(canvas); 380 View::OnPaint(canvas);
381 Painter::PaintFocusPainter(this, canvas, focus_painter_.get()); 381 Painter::PaintFocusPainter(this, canvas, focus_painter_.get());
382 } 382 }
383 383
384 void LabelButton::OnFocus() { 384 void LabelButton::OnFocus() {
385 View::OnFocus(); 385 CustomButton::OnFocus();
386 // Typically the border renders differently when focused. 386 // Typically the border renders differently when focused.
387 SchedulePaint(); 387 SchedulePaint();
388 } 388 }
389 389
390 void LabelButton::OnBlur() { 390 void LabelButton::OnBlur() {
391 View::OnBlur(); 391 CustomButton::OnBlur();
392 // Typically the border renders differently when focused. 392 // Typically the border renders differently when focused.
393 SchedulePaint(); 393 SchedulePaint();
394 } 394 }
395 395
396 void LabelButton::OnNativeThemeChanged(const ui::NativeTheme* theme) { 396 void LabelButton::OnNativeThemeChanged(const ui::NativeTheme* theme) {
397 ResetColorsFromNativeTheme(); 397 ResetColorsFromNativeTheme();
398 UpdateThemedBorder(); 398 UpdateThemedBorder();
399 // Invalidate the layout to pickup the new insets from the border. 399 // Invalidate the layout to pickup the new insets from the border.
400 InvalidateLayout(); 400 InvalidateLayout();
401 } 401 }
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 GetExtraParams(params); 567 GetExtraParams(params);
568 return ui::NativeTheme::kHovered; 568 return ui::NativeTheme::kHovered;
569 } 569 }
570 570
571 void LabelButton::ResetCachedPreferredSize() { 571 void LabelButton::ResetCachedPreferredSize() {
572 cached_preferred_size_valid_ = false; 572 cached_preferred_size_valid_ = false;
573 cached_preferred_size_ = gfx::Size(); 573 cached_preferred_size_ = gfx::Size();
574 } 574 }
575 575
576 } // namespace views 576 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/image_button.cc ('k') | ui/views/controls/button/md_text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698