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

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

Issue 2026833003: MD - update checkbox and radio buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky review Created 4 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
« no previous file with comments | « ui/views/controls/button/label_button.h ('k') | ui/views/controls/button/radio_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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 // Inset the button focus rect from the actual border; roughly match Windows. 110 // Inset the button focus rect from the actual border; roughly match Windows.
111 if (!ui::MaterialDesignController::IsModeMaterial()) { 111 if (!ui::MaterialDesignController::IsModeMaterial()) {
112 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets(gfx::Insets( 112 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets(gfx::Insets(
113 kFocusRectInset, kFocusRectInset, kFocusRectInset, kFocusRectInset))); 113 kFocusRectInset, kFocusRectInset, kFocusRectInset, kFocusRectInset)));
114 } 114 }
115 } 115 }
116 116
117 LabelButton::~LabelButton() {} 117 LabelButton::~LabelButton() {}
118 118
119 const gfx::ImageSkia& LabelButton::GetImage(ButtonState for_state) { 119 gfx::ImageSkia LabelButton::GetImage(ButtonState for_state) const {
120 if (for_state != STATE_NORMAL && button_state_images_[for_state].isNull()) 120 if (for_state != STATE_NORMAL && button_state_images_[for_state].isNull())
121 return button_state_images_[STATE_NORMAL]; 121 return button_state_images_[STATE_NORMAL];
122 return button_state_images_[for_state]; 122 return button_state_images_[for_state];
123 } 123 }
124 124
125 void LabelButton::SetImage(ButtonState for_state, const gfx::ImageSkia& image) { 125 void LabelButton::SetImage(ButtonState for_state, const gfx::ImageSkia& image) {
126 button_state_images_[for_state] = image; 126 button_state_images_[for_state] = image;
127 UpdateImage(); 127 UpdateImage();
128 } 128 }
129 129
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 void LabelButton::ResetLabelEnabledColor() { 571 void LabelButton::ResetLabelEnabledColor() {
572 const SkColor color = 572 const SkColor color =
573 explicitly_set_colors_[state()] 573 explicitly_set_colors_[state()]
574 ? button_state_colors_[state()] 574 ? button_state_colors_[state()]
575 : PlatformStyle::TextColorForButton(button_state_colors_, *this); 575 : PlatformStyle::TextColorForButton(button_state_colors_, *this);
576 if (state() != STATE_DISABLED && label_->enabled_color() != color) 576 if (state() != STATE_DISABLED && label_->enabled_color() != color)
577 label_->SetEnabledColor(color); 577 label_->SetEnabledColor(color);
578 } 578 }
579 579
580 } // namespace views 580 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.h ('k') | ui/views/controls/button/radio_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698