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

Side by Side Diff: chrome/browser/views/theme_helpers.cc

Issue 125109: Refactor the PlatformContext layer to have only one class. (Closed)
Patch Set: Created 11 years, 6 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/views/theme_helpers.h" 5 #include "chrome/browser/views/theme_helpers.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlapp.h> 8 #include <atlapp.h>
9 #include <atltheme.h> 9 #include <atltheme.h>
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // the gradient. 57 // the gradient.
58 gradient_shader->unref(); 58 gradient_shader->unref();
59 paint.setStyle(SkPaint::kFill_Style); 59 paint.setStyle(SkPaint::kFill_Style);
60 canvas.drawRectCoords(SkIntToScalar(0), SkIntToScalar(0), 60 canvas.drawRectCoords(SkIntToScalar(0), SkIntToScalar(0),
61 SkIntToScalar(width), SkIntToScalar(1), paint); 61 SkIntToScalar(width), SkIntToScalar(1), paint);
62 } 62 }
63 63
64 // Extract the color values from the selected pixels 64 // Extract the color values from the selected pixels
65 // The | in the following operations forces the alpha to 0xFF. This is 65 // The | in the following operations forces the alpha to 0xFF. This is
66 // needed as windows sets the alpha to 0 when it renders. 66 // needed as windows sets the alpha to 0 when it renders.
67 skia::BitmapPlatformDeviceWin& device = 67 skia::BitmapPlatformDevice& device =
68 static_cast<skia::BitmapPlatformDeviceWin&>( 68 static_cast<skia::BitmapPlatformDevice&>(
69 canvas.getTopPlatformDevice()); 69 canvas.getTopPlatformDevice());
70 *c1 = 0xFF000000 | device.getColorAt(x1, 0); 70 *c1 = 0xFF000000 | device.getColorAt(x1, 0);
71 *c2 = 0xFF000000 | device.getColorAt(x2, 0); 71 *c2 = 0xFF000000 | device.getColorAt(x2, 0);
72 } 72 }
73 73
74 void GetDarkLineColor(SkColor* dark_color) { 74 void GetDarkLineColor(SkColor* dark_color) {
75 DCHECK(dark_color) << "ThemeHelpers::DarkColor - dark_color is NULL!"; 75 DCHECK(dark_color) << "ThemeHelpers::DarkColor - dark_color is NULL!";
76 76
77 CTheme theme; 77 CTheme theme;
78 if (theme.IsThemingSupported()) 78 if (theme.IsThemingSupported())
79 theme.OpenThemeData(NULL, L"REBAR"); 79 theme.OpenThemeData(NULL, L"REBAR");
80 80
81 // Note: the alpha values were chosen scientifically according to what looked 81 // Note: the alpha values were chosen scientifically according to what looked
82 // best to me at the time! --beng 82 // best to me at the time! --beng
83 if (!theme.IsThemeNull()) { 83 if (!theme.IsThemeNull()) {
84 *dark_color = SkColorSetARGB(60, 0, 0, 0); 84 *dark_color = SkColorSetARGB(60, 0, 0, 0);
85 } else { 85 } else {
86 COLORREF shadow_ref = ::GetSysColor(COLOR_3DSHADOW); 86 COLORREF shadow_ref = ::GetSysColor(COLOR_3DSHADOW);
87 *dark_color = SkColorSetARGB(175, 87 *dark_color = SkColorSetARGB(175,
88 GetRValue(shadow_ref), 88 GetRValue(shadow_ref),
89 GetGValue(shadow_ref), 89 GetGValue(shadow_ref),
90 GetBValue(shadow_ref)); 90 GetBValue(shadow_ref));
91 } 91 }
92 } 92 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_view_win.cc ('k') | chrome/plugin/webplugin_delegate_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698