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

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: Finish Plumbing Created 3 years, 12 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 NOTIMPLEMENTED(); 235 NOTIMPLEMENTED();
236 break; 236 break;
237 default: 237 default:
238 NOTREACHED() << "Unknown theme part: " << part; 238 NOTREACHED() << "Unknown theme part: " << part;
239 break; 239 break;
240 } 240 }
241 241
242 canvas->restore(); 242 canvas->restore();
243 } 243 }
244 244
245 bool NativeThemeBase::SupportsNinePatch(Part part) const {
246 return false;
247 }
248
249 gfx::Size NativeThemeBase::GetNinePatchCanvasSize(Part part) const {
250 NOTREACHED() << "NativeThemeBase doesn't support nine-patch resources.";
251 return gfx::Size();
252 }
253
254 gfx::Rect NativeThemeBase::GetNinePatchAperture(Part part) const {
255 NOTREACHED() << "NativeThemeBase doesn't support nine-patch resources.";
256 return gfx::Rect();
257 }
258
245 NativeThemeBase::NativeThemeBase() 259 NativeThemeBase::NativeThemeBase()
246 : scrollbar_width_(kDefaultScrollbarWidth), 260 : scrollbar_width_(kDefaultScrollbarWidth),
247 scrollbar_button_length_(kDefaultScrollbarButtonLength) { 261 scrollbar_button_length_(kDefaultScrollbarButtonLength) {
248 } 262 }
249 263
250 NativeThemeBase::~NativeThemeBase() { 264 NativeThemeBase::~NativeThemeBase() {
251 } 265 }
252 266
253 void NativeThemeBase::PaintArrowButton( 267 void NativeThemeBase::PaintArrowButton(
254 SkCanvas* canvas, 268 SkCanvas* canvas,
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); 1006 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f);
993 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); 1007 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
994 1008
995 if (hsv1[2] + hsv2[2] > 1.0) 1009 if (hsv1[2] + hsv2[2] > 1.0)
996 diff = -diff; 1010 diff = -diff;
997 1011
998 return SaturateAndBrighten(hsv2, -0.2f, diff); 1012 return SaturateAndBrighten(hsv2, -0.2f, diff);
999 } 1013 }
1000 1014
1001 } // namespace ui 1015 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698