OLD | NEW |
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_win.h" | 5 #include "ui/native_theme/native_theme_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <uxtheme.h> | 9 #include <uxtheme.h> |
10 #include <vsstyle.h> | 10 #include <vsstyle.h> |
11 #include <vssym32.h> | 11 #include <vssym32.h> |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/win/scoped_gdi_object.h" | 15 #include "base/win/scoped_gdi_object.h" |
16 #include "base/win/scoped_hdc.h" | 16 #include "base/win/scoped_hdc.h" |
17 #include "base/win/scoped_select_object.h" | 17 #include "base/win/scoped_select_object.h" |
18 #include "base/win/windows_version.h" | 18 #include "base/win/windows_version.h" |
19 #include "skia/ext/bitmap_platform_device.h" | 19 #include "skia/ext/bitmap_platform_device.h" |
20 #include "skia/ext/platform_canvas.h" | 20 #include "skia/ext/platform_canvas.h" |
21 #include "skia/ext/skia_utils_win.h" | 21 #include "skia/ext/skia_utils_win.h" |
22 #include "third_party/skia/include/core/SkCanvas.h" | 22 #include "third_party/skia/include/core/SkCanvas.h" |
23 #include "third_party/skia/include/core/SkColor.h" | 23 #include "third_party/skia/include/core/SkColor.h" |
24 #include "third_party/skia/include/core/SkColorPriv.h" | 24 #include "third_party/skia/include/core/SkColorPriv.h" |
25 #include "third_party/skia/include/core/SkShader.h" | 25 #include "third_party/skia/include/core/SkShader.h" |
26 #include "ui/base/material_design/material_design_controller.h" | 26 #include "ui/base/material_design/material_design_controller.h" |
| 27 #include "ui/display/win/dpi.h" |
27 #include "ui/gfx/color_palette.h" | 28 #include "ui/gfx/color_palette.h" |
28 #include "ui/gfx/color_utils.h" | 29 #include "ui/gfx/color_utils.h" |
29 #include "ui/gfx/gdi_util.h" | 30 #include "ui/gfx/gdi_util.h" |
30 #include "ui/gfx/geometry/rect.h" | 31 #include "ui/gfx/geometry/rect.h" |
31 #include "ui/gfx/geometry/rect_conversions.h" | 32 #include "ui/gfx/geometry/rect_conversions.h" |
32 #include "ui/gfx/skia_util.h" | 33 #include "ui/gfx/skia_util.h" |
33 #include "ui/gfx/win/dpi.h" | |
34 #include "ui/native_theme/common_theme.h" | 34 #include "ui/native_theme/common_theme.h" |
35 | 35 |
36 // This was removed from Winvers.h but is still used. | 36 // This was removed from Winvers.h but is still used. |
37 #if !defined(COLOR_MENUHIGHLIGHT) | 37 #if !defined(COLOR_MENUHIGHLIGHT) |
38 #define COLOR_MENUHIGHLIGHT 29 | 38 #define COLOR_MENUHIGHLIGHT 29 |
39 #endif | 39 #endif |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
43 // Windows system color IDs cached and updated by the native theme. | 43 // Windows system color IDs cached and updated by the native theme. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // accounting for user customization (crbug/218291). | 196 // accounting for user customization (crbug/218291). |
197 switch (part) { | 197 switch (part) { |
198 case kScrollbarDownArrow: | 198 case kScrollbarDownArrow: |
199 case kScrollbarLeftArrow: | 199 case kScrollbarLeftArrow: |
200 case kScrollbarRightArrow: | 200 case kScrollbarRightArrow: |
201 case kScrollbarUpArrow: | 201 case kScrollbarUpArrow: |
202 case kScrollbarHorizontalThumb: | 202 case kScrollbarHorizontalThumb: |
203 case kScrollbarVerticalThumb: | 203 case kScrollbarVerticalThumb: |
204 case kScrollbarHorizontalTrack: | 204 case kScrollbarHorizontalTrack: |
205 case kScrollbarVerticalTrack: { | 205 case kScrollbarVerticalTrack: { |
206 int size = gfx::win::GetSystemMetricsInDIP(SM_CXVSCROLL); | 206 int size = display::win::GetSystemMetricsInDIP(SM_CXVSCROLL); |
207 if (size == 0) | 207 if (size == 0) |
208 size = 17; | 208 size = 17; |
209 return gfx::Size(size, size); | 209 return gfx::Size(size, size); |
210 } | 210 } |
211 default: | 211 default: |
212 break; | 212 break; |
213 } | 213 } |
214 | 214 |
215 int part_id = GetWindowsPart(part, state, extra); | 215 int part_id = GetWindowsPart(part, state, extra); |
216 int state_id = GetWindowsState(part, state, extra); | 216 int state_id = GetWindowsState(part, state, extra); |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2071 break; | 2071 break; |
2072 case LAST: | 2072 case LAST: |
2073 NOTREACHED(); | 2073 NOTREACHED(); |
2074 break; | 2074 break; |
2075 } | 2075 } |
2076 theme_handles_[theme_name] = handle; | 2076 theme_handles_[theme_name] = handle; |
2077 return handle; | 2077 return handle; |
2078 } | 2078 } |
2079 | 2079 |
2080 } // namespace ui | 2080 } // namespace ui |
OLD | NEW |