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

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

Issue 2302173002: Update Harmony textfield and combobox default border color. (Closed)
Patch Set: also tweak checkbox/radio Created 4 years, 3 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/native_theme/common_theme.cc ('k') | no next file » | 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/checkbox.h" 5 #include "ui/views/controls/button/checkbox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 std::unique_ptr<InkDropRipple> Checkbox::CreateInkDropRipple() const { 167 std::unique_ptr<InkDropRipple> Checkbox::CreateInkDropRipple() const {
168 return CreateDefaultInkDropRipple(image()->bounds().CenterPoint()); 168 return CreateDefaultInkDropRipple(image()->bounds().CenterPoint());
169 } 169 }
170 170
171 std::unique_ptr<InkDropHighlight> Checkbox::CreateInkDropHighlight() const { 171 std::unique_ptr<InkDropHighlight> Checkbox::CreateInkDropHighlight() const {
172 return nullptr; 172 return nullptr;
173 } 173 }
174 174
175 SkColor Checkbox::GetInkDropBaseColor() const { 175 SkColor Checkbox::GetInkDropBaseColor() const {
176 return GetNativeTheme()->GetSystemColor( 176 return GetNativeTheme()->GetSystemColor(
177 ui::NativeTheme::kColorId_UnfocusedBorderColor); 177 ui::NativeTheme::kColorId_ButtonEnabledColor);
178 } 178 }
179 179
180 gfx::ImageSkia Checkbox::GetImage(ButtonState for_state) const { 180 gfx::ImageSkia Checkbox::GetImage(ButtonState for_state) const {
181 if (UseMd()) { 181 if (UseMd()) {
182 return gfx::CreateVectorIcon( 182 return gfx::CreateVectorIcon(
183 GetVectorIconId(), 16, 183 GetVectorIconId(), 16,
184 // When not checked, the icon color matches the button text color. 184 // When not checked, the icon color matches the button text color.
185 GetNativeTheme()->GetSystemColor( 185 GetNativeTheme()->GetSystemColor(
186 checked_ ? ui::NativeTheme::kColorId_CallToActionColor 186 checked_ ? ui::NativeTheme::kColorId_FocusedBorderColor
187 : ui::NativeTheme::kColorId_ButtonEnabledColor)); 187 : ui::NativeTheme::kColorId_ButtonEnabledColor));
188 } 188 }
189 189
190 const size_t checked_index = checked_ ? 1 : 0; 190 const size_t checked_index = checked_ ? 1 : 0;
191 const size_t focused_index = HasFocus() ? 1 : 0; 191 const size_t focused_index = HasFocus() ? 1 : 0;
192 if (for_state != STATE_NORMAL && 192 if (for_state != STATE_NORMAL &&
193 images_[checked_index][focused_index][for_state].isNull()) 193 images_[checked_index][focused_index][for_state].isNull())
194 return images_[checked_index][focused_index][STATE_NORMAL]; 194 return images_[checked_index][focused_index][STATE_NORMAL];
195 return images_[checked_index][focused_index][for_state]; 195 return images_[checked_index][focused_index][for_state];
196 } 196 }
(...skipping 26 matching lines...) Expand all
223 ui::NativeTheme::Part Checkbox::GetThemePart() const { 223 ui::NativeTheme::Part Checkbox::GetThemePart() const {
224 return ui::NativeTheme::kCheckbox; 224 return ui::NativeTheme::kCheckbox;
225 } 225 }
226 226
227 void Checkbox::GetExtraParams(ui::NativeTheme::ExtraParams* params) const { 227 void Checkbox::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
228 LabelButton::GetExtraParams(params); 228 LabelButton::GetExtraParams(params);
229 params->button.checked = checked_; 229 params->button.checked = checked_;
230 } 230 }
231 231
232 } // namespace views 232 } // namespace views
OLDNEW
« no previous file with comments | « ui/native_theme/common_theme.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698