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

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

Issue 2591863003: Use nine-patch resource for drawing Aura overlay scrollbar thumb. (Closed)
Patch Set: Addressed sadrul@'s feedback Created 3 years, 9 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
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 #include <memory> 8 #include <memory>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 NOTIMPLEMENTED(); 244 NOTIMPLEMENTED();
245 break; 245 break;
246 default: 246 default:
247 NOTREACHED() << "Unknown theme part: " << part; 247 NOTREACHED() << "Unknown theme part: " << part;
248 break; 248 break;
249 } 249 }
250 250
251 canvas->restore(); 251 canvas->restore();
252 } 252 }
253 253
254 bool NativeThemeBase::SupportsNinePatch(Part part) const {
255 return false;
256 }
257
258 gfx::Size NativeThemeBase::GetNinePatchCanvasSize(Part part) const {
259 NOTREACHED() << "NativeThemeBase doesn't support nine-patch resources.";
260 return gfx::Size();
261 }
262
263 gfx::Rect NativeThemeBase::GetNinePatchAperture(Part part) const {
264 NOTREACHED() << "NativeThemeBase doesn't support nine-patch resources.";
265 return gfx::Rect();
266 }
267
254 NativeThemeBase::NativeThemeBase() 268 NativeThemeBase::NativeThemeBase()
255 : scrollbar_width_(kDefaultScrollbarWidth), 269 : scrollbar_width_(kDefaultScrollbarWidth),
256 scrollbar_button_length_(kDefaultScrollbarButtonLength) { 270 scrollbar_button_length_(kDefaultScrollbarButtonLength) {
257 } 271 }
258 272
259 NativeThemeBase::~NativeThemeBase() { 273 NativeThemeBase::~NativeThemeBase() {
260 } 274 }
261 275
262 void NativeThemeBase::PaintArrowButton(cc::PaintCanvas* canvas, 276 void NativeThemeBase::PaintArrowButton(cc::PaintCanvas* canvas,
263 const gfx::Rect& rect, 277 const gfx::Rect& rect,
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); 1016 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f);
1003 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); 1017 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
1004 1018
1005 if (hsv1[2] + hsv2[2] > 1.0) 1019 if (hsv1[2] + hsv2[2] > 1.0)
1006 diff = -diff; 1020 diff = -diff;
1007 1021
1008 return SaturateAndBrighten(hsv2, -0.2f, diff); 1022 return SaturateAndBrighten(hsv2, -0.2f, diff);
1009 } 1023 }
1010 1024
1011 } // namespace ui 1025 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698