OLD | NEW |
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // the gradient. | 55 // the gradient. |
56 gradient_shader->unref(); | 56 gradient_shader->unref(); |
57 paint.setStyle(SkPaint::kFill_Style); | 57 paint.setStyle(SkPaint::kFill_Style); |
58 canvas.drawRectCoords(SkIntToScalar(0), SkIntToScalar(0), | 58 canvas.drawRectCoords(SkIntToScalar(0), SkIntToScalar(0), |
59 SkIntToScalar(width), SkIntToScalar(1), paint); | 59 SkIntToScalar(width), SkIntToScalar(1), paint); |
60 } | 60 } |
61 | 61 |
62 // Extract the color values from the selected pixels | 62 // Extract the color values from the selected pixels |
63 // The | in the following operations forces the alpha to 0xFF. This is | 63 // The | in the following operations forces the alpha to 0xFF. This is |
64 // needed as windows sets the alpha to 0 when it renders. | 64 // needed as windows sets the alpha to 0 when it renders. |
65 gfx::BitmapPlatformDeviceWin& device = | 65 skia::BitmapPlatformDeviceWin& device = |
66 static_cast<gfx::BitmapPlatformDeviceWin&>(canvas.getTopPlatformDevice()); | 66 static_cast<skia::BitmapPlatformDeviceWin&>(canvas.getTopPlatformDevice())
; |
67 *c1 = 0xFF000000 | device.getColorAt(x1, 0); | 67 *c1 = 0xFF000000 | device.getColorAt(x1, 0); |
68 *c2 = 0xFF000000 | device.getColorAt(x2, 0); | 68 *c2 = 0xFF000000 | device.getColorAt(x2, 0); |
69 } | 69 } |
70 | 70 |
71 void GetDarkLineColor(SkColor* dark_color) { | 71 void GetDarkLineColor(SkColor* dark_color) { |
72 DCHECK(dark_color) << "ThemeHelpers::DarkColor - dark_color is NULL!"; | 72 DCHECK(dark_color) << "ThemeHelpers::DarkColor - dark_color is NULL!"; |
73 | 73 |
74 CTheme theme; | 74 CTheme theme; |
75 if (theme.IsThemingSupported()) | 75 if (theme.IsThemingSupported()) |
76 theme.OpenThemeData(NULL, L"REBAR"); | 76 theme.OpenThemeData(NULL, L"REBAR"); |
77 | 77 |
78 // Note: the alpha values were chosen scientifically according to what looked | 78 // Note: the alpha values were chosen scientifically according to what looked |
79 // best to me at the time! --beng | 79 // best to me at the time! --beng |
80 if (!theme.IsThemeNull()) { | 80 if (!theme.IsThemeNull()) { |
81 *dark_color = SkColorSetARGB(60, 0, 0, 0); | 81 *dark_color = SkColorSetARGB(60, 0, 0, 0); |
82 } else { | 82 } else { |
83 COLORREF shadow_ref = ::GetSysColor(COLOR_3DSHADOW); | 83 COLORREF shadow_ref = ::GetSysColor(COLOR_3DSHADOW); |
84 *dark_color = SkColorSetARGB(175, | 84 *dark_color = SkColorSetARGB(175, |
85 GetRValue(shadow_ref), | 85 GetRValue(shadow_ref), |
86 GetGValue(shadow_ref), | 86 GetGValue(shadow_ref), |
87 GetBValue(shadow_ref)); | 87 GetBValue(shadow_ref)); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 | 91 |
OLD | NEW |