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

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

Issue 2069733002: MD - Use real comboboxes in website settings popup. Hide borders (but (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment 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/blue_button_unittest.cc ('k') | ui/views/controls/combobox/combobox.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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 AddChildView(image_); 121 AddChildView(image_);
122 image_->set_interactive(false); 122 image_->set_interactive(false);
123 123
124 AddChildView(label_); 124 AddChildView(label_);
125 label_->SetFontList(cached_normal_font_list_); 125 label_->SetFontList(cached_normal_font_list_);
126 label_->SetAutoColorReadabilityEnabled(false); 126 label_->SetAutoColorReadabilityEnabled(false);
127 label_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD); 127 label_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD);
128 128
129 // Inset the button focus rect from the actual border; roughly match Windows. 129 // Inset the button focus rect from the actual border; roughly match Windows.
130 if (!ui::MaterialDesignController::IsModeMaterial()) { 130 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets(gfx::Insets(
131 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets(gfx::Insets( 131 kFocusRectInset, kFocusRectInset, kFocusRectInset, kFocusRectInset)));
132 kFocusRectInset, kFocusRectInset, kFocusRectInset, kFocusRectInset)));
133 }
134 } 132 }
135 133
136 LabelButton::~LabelButton() {} 134 LabelButton::~LabelButton() {}
137 135
138 gfx::ImageSkia LabelButton::GetImage(ButtonState for_state) const { 136 gfx::ImageSkia LabelButton::GetImage(ButtonState for_state) const {
139 if (for_state != STATE_NORMAL && button_state_images_[for_state].isNull()) 137 if (for_state != STATE_NORMAL && button_state_images_[for_state].isNull())
140 return button_state_images_[STATE_NORMAL]; 138 return button_state_images_[STATE_NORMAL];
141 return button_state_images_[for_state]; 139 return button_state_images_[for_state];
142 } 140 }
143 141
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 void LabelButton::ResetLabelEnabledColor() { 587 void LabelButton::ResetLabelEnabledColor() {
590 const SkColor color = 588 const SkColor color =
591 explicitly_set_colors_[state()] 589 explicitly_set_colors_[state()]
592 ? button_state_colors_[state()] 590 ? button_state_colors_[state()]
593 : PlatformStyle::TextColorForButton(button_state_colors_, *this); 591 : PlatformStyle::TextColorForButton(button_state_colors_, *this);
594 if (state() != STATE_DISABLED && label_->enabled_color() != color) 592 if (state() != STATE_DISABLED && label_->enabled_color() != color)
595 label_->SetEnabledColor(color); 593 label_->SetEnabledColor(color);
596 } 594 }
597 595
598 } // namespace views 596 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/blue_button_unittest.cc ('k') | ui/views/controls/combobox/combobox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698