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

Side by Side Diff: ui/native_theme/native_theme_base.cc

Issue 1863503002: test hypothesis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: zappity 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/native_theme/native_theme_aurawin.cc ('k') | ui/native_theme/native_theme_win.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/native_theme/native_theme_base.h" 5 #include "ui/native_theme/native_theme_base.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return color_utils::HSLToSkColor(adjusted, alpha); 90 return color_utils::HSLToSkColor(adjusted, alpha);
91 } 91 }
92 92
93 } // namespace 93 } // namespace
94 94
95 namespace ui { 95 namespace ui {
96 96
97 gfx::Size NativeThemeBase::GetPartSize(Part part, 97 gfx::Size NativeThemeBase::GetPartSize(Part part,
98 State state, 98 State state,
99 const ExtraParams& extra) const { 99 const ExtraParams& extra) const {
100 gfx::Size size = CommonThemeGetPartSize(part, state, extra);
101 if (!size.IsEmpty())
102 return size;
103
104 switch (part) { 100 switch (part) {
105 // Please keep these in the order of NativeTheme::Part. 101 // Please keep these in the order of NativeTheme::Part.
106 case kCheckbox: 102 case kCheckbox:
107 return gfx::Size(kCheckboxAndRadioWidth, kCheckboxAndRadioHeight); 103 return gfx::Size(kCheckboxAndRadioWidth, kCheckboxAndRadioHeight);
108 case kInnerSpinButton: 104 case kInnerSpinButton:
109 return gfx::Size(scrollbar_width_, 0); 105 return gfx::Size(scrollbar_width_, 0);
110 case kMenuList: 106 case kMenuList:
111 return gfx::Size(); // No default size. 107 return gfx::Size(); // No default size.
112 case kMenuPopupBackground: 108 case kMenuPopupBackground:
113 return gfx::Size(); // No default size. 109 return gfx::Size(); // No default size.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 const gfx::Rect& rect, 186 const gfx::Rect& rect,
191 const ExtraParams& extra) const { 187 const ExtraParams& extra) const {
192 if (rect.IsEmpty()) 188 if (rect.IsEmpty())
193 return; 189 return;
194 190
195 canvas->save(); 191 canvas->save();
196 canvas->clipRect(gfx::RectToSkRect(rect)); 192 canvas->clipRect(gfx::RectToSkRect(rect));
197 193
198 switch (part) { 194 switch (part) {
199 // Please keep these in the order of NativeTheme::Part. 195 // Please keep these in the order of NativeTheme::Part.
200 case kComboboxArrow:
201 CommonThemePaintComboboxArrow(canvas, rect);
202 break;
203 case kCheckbox: 196 case kCheckbox:
204 PaintCheckbox(canvas, state, rect, extra.button); 197 PaintCheckbox(canvas, state, rect, extra.button);
205 break; 198 break;
206 case kInnerSpinButton: 199 case kInnerSpinButton:
207 PaintInnerSpinButton(canvas, state, rect, extra.inner_spin); 200 PaintInnerSpinButton(canvas, state, rect, extra.inner_spin);
208 break; 201 break;
209 case kMenuList: 202 case kMenuList:
210 PaintMenuList(canvas, state, rect, extra.menu_list); 203 PaintMenuList(canvas, state, rect, extra.menu_list);
211 break; 204 break;
212 case kMenuPopupBackground: 205 case kMenuPopupBackground:
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); 1025 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f);
1033 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); 1026 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
1034 1027
1035 if (hsv1[2] + hsv2[2] > 1.0) 1028 if (hsv1[2] + hsv2[2] > 1.0)
1036 diff = -diff; 1029 diff = -diff;
1037 1030
1038 return SaturateAndBrighten(hsv2, -0.2f, diff); 1031 return SaturateAndBrighten(hsv2, -0.2f, diff);
1039 } 1032 }
1040 1033
1041 } // namespace ui 1034 } // namespace ui
OLDNEW
« no previous file with comments | « ui/native_theme/native_theme_aurawin.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698