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

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

Issue 1482863002: Add support for drawing window caption buttons on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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.h ('k') | ui/native_theme/native_theme_win.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/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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // These sizes match the sizes in Chromium Win. 143 // These sizes match the sizes in Chromium Win.
144 return gfx::Size(kSliderThumbWidth, kSliderThumbHeight); 144 return gfx::Size(kSliderThumbWidth, kSliderThumbHeight);
145 case kTabPanelBackground: 145 case kTabPanelBackground:
146 NOTIMPLEMENTED(); 146 NOTIMPLEMENTED();
147 break; 147 break;
148 case kTextField: 148 case kTextField:
149 return gfx::Size(); // No default size. 149 return gfx::Size(); // No default size.
150 case kTrackbarThumb: 150 case kTrackbarThumb:
151 case kTrackbarTrack: 151 case kTrackbarTrack:
152 case kWindowResizeGripper: 152 case kWindowResizeGripper:
153 case kCaptionMin:
154 case kCaptionMax:
155 case kCaptionRestore:
156 case kCaptionClose:
153 NOTIMPLEMENTED(); 157 NOTIMPLEMENTED();
154 break; 158 break;
155 default: 159 default:
156 NOTREACHED() << "Unknown theme part: " << part; 160 NOTREACHED() << "Unknown theme part: " << part;
157 break; 161 break;
158 } 162 }
159 return gfx::Size(); 163 return gfx::Size();
160 } 164 }
161 165
162 void NativeThemeBase::PaintStateTransition(SkCanvas* canvas, 166 void NativeThemeBase::PaintStateTransition(SkCanvas* canvas,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 break; 259 break;
256 case kTabPanelBackground: 260 case kTabPanelBackground:
257 NOTIMPLEMENTED(); 261 NOTIMPLEMENTED();
258 break; 262 break;
259 case kTextField: 263 case kTextField:
260 PaintTextField(canvas, state, rect, extra.text_field); 264 PaintTextField(canvas, state, rect, extra.text_field);
261 break; 265 break;
262 case kTrackbarThumb: 266 case kTrackbarThumb:
263 case kTrackbarTrack: 267 case kTrackbarTrack:
264 case kWindowResizeGripper: 268 case kWindowResizeGripper:
269 case kCaptionMin:
270 case kCaptionMax:
271 case kCaptionRestore:
272 case kCaptionClose:
265 NOTIMPLEMENTED(); 273 NOTIMPLEMENTED();
266 break; 274 break;
267 default: 275 default:
268 NOTREACHED() << "Unknown theme part: " << part; 276 NOTREACHED() << "Unknown theme part: " << part;
269 break; 277 break;
270 } 278 }
271 279
272 canvas->restore(); 280 canvas->restore();
273 } 281 }
274 282
(...skipping 757 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); 1040 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); 1041 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
1034 1042
1035 if (hsv1[2] + hsv2[2] > 1.0) 1043 if (hsv1[2] + hsv2[2] > 1.0)
1036 diff = -diff; 1044 diff = -diff;
1037 1045
1038 return SaturateAndBrighten(hsv2, -0.2f, diff); 1046 return SaturateAndBrighten(hsv2, -0.2f, diff);
1039 } 1047 }
1040 1048
1041 } // namespace ui 1049 } // namespace ui
OLDNEW
« no previous file with comments | « ui/native_theme/native_theme.h ('k') | ui/native_theme/native_theme_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698