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 <uxtheme.h> | 8 #include <uxtheme.h> |
9 #include <vsstyle.h> | 9 #include <vsstyle.h> |
10 #include <vssym32.h> | 10 #include <vssym32.h> |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 CommonThemePaintMenuItemBackground(canvas, state, rect); | 303 CommonThemePaintMenuItemBackground(canvas, state, rect); |
304 return; | 304 return; |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 bool needs_paint_indirect = false; | 308 bool needs_paint_indirect = false; |
309 if (!skia::SupportsPlatformPaint(canvas)) { | 309 if (!skia::SupportsPlatformPaint(canvas)) { |
310 // This block will only get hit with --enable-accelerated-drawing flag. | 310 // This block will only get hit with --enable-accelerated-drawing flag. |
311 needs_paint_indirect = true; | 311 needs_paint_indirect = true; |
312 } else { | 312 } else { |
313 // Scrollbars on Windows XP and the Windows Classic theme have particularly | 313 // Scrollbar components on Windows Classic theme (on all Windows versions) |
314 // problematic alpha values, so always draw them indirectly. | 314 // have particularly problematic alpha values, so always draw them |
| 315 // indirectly. In addition, scrollbar thumbs and grippers for the Windows XP |
| 316 // theme (available only on Windows XP) also need their alpha values |
| 317 // fixed. |
315 switch (part) { | 318 switch (part) { |
316 case kScrollbarDownArrow: | 319 case kScrollbarDownArrow: |
317 case kScrollbarUpArrow: | 320 case kScrollbarUpArrow: |
318 case kScrollbarLeftArrow: | 321 case kScrollbarLeftArrow: |
319 case kScrollbarRightArrow: | 322 case kScrollbarRightArrow: |
| 323 if (!GetThemeHandle(SCROLLBAR)) |
| 324 needs_paint_indirect = true; |
| 325 break; |
320 case kScrollbarHorizontalThumb: | 326 case kScrollbarHorizontalThumb: |
321 case kScrollbarVerticalThumb: | 327 case kScrollbarVerticalThumb: |
322 case kScrollbarHorizontalGripper: | 328 case kScrollbarHorizontalGripper: |
323 case kScrollbarVerticalGripper: | 329 case kScrollbarVerticalGripper: |
324 if (!GetThemeHandle(SCROLLBAR)) | 330 if (!GetThemeHandle(SCROLLBAR) || |
| 331 base::win::GetVersion() == base::win::VERSION_XP) |
325 needs_paint_indirect = true; | 332 needs_paint_indirect = true; |
326 break; | 333 break; |
327 default: | 334 default: |
328 break; | 335 break; |
329 } | 336 } |
330 } | 337 } |
331 | 338 |
332 if (needs_paint_indirect) | 339 if (needs_paint_indirect) |
333 PaintIndirect(canvas, part, state, rect, extra); | 340 PaintIndirect(canvas, part, state, rect, extra); |
334 else | 341 else |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 handle = open_theme_(NULL, L"Spin"); | 2094 handle = open_theme_(NULL, L"Spin"); |
2088 break; | 2095 break; |
2089 default: | 2096 default: |
2090 NOTREACHED(); | 2097 NOTREACHED(); |
2091 } | 2098 } |
2092 theme_handles_[theme_name] = handle; | 2099 theme_handles_[theme_name] = handle; |
2093 return handle; | 2100 return handle; |
2094 } | 2101 } |
2095 | 2102 |
2096 } // namespace ui | 2103 } // namespace ui |
OLD | NEW |