OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "gfx/native_theme_win.h" | 5 #include "gfx/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> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/scoped_handle.h" | 13 #include "base/scoped_handle.h" |
14 #include "base/win_util.h" | 14 #include "base/win/windows_version.h" |
15 #include "gfx/gdi_util.h" | 15 #include "gfx/gdi_util.h" |
16 #include "gfx/rect.h" | 16 #include "gfx/rect.h" |
17 #include "skia/ext/platform_canvas.h" | 17 #include "skia/ext/platform_canvas.h" |
18 #include "skia/ext/skia_utils_win.h" | 18 #include "skia/ext/skia_utils_win.h" |
19 #include "third_party/skia/include/core/SkShader.h" | 19 #include "third_party/skia/include/core/SkShader.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 void SetCheckerboardShader(SkPaint* paint, const RECT& align_rect) { | 23 void SetCheckerboardShader(SkPaint* paint, const RECT& align_rect) { |
24 // Create a 2x2 checkerboard pattern using the 3D face and highlight colors. | 24 // Create a 2x2 checkerboard pattern using the 3D face and highlight colors. |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 // size of moving overlay of the indeterminate progress bar. | 528 // size of moving overlay of the indeterminate progress bar. |
529 // So we just observed real-world programs and guessed following parameters. | 529 // So we just observed real-world programs and guessed following parameters. |
530 const int kDeteminateOverlayPixelsPerSecond = 300; | 530 const int kDeteminateOverlayPixelsPerSecond = 300; |
531 const int kDeteminateOverlayWidth = 120; | 531 const int kDeteminateOverlayWidth = 120; |
532 const int kIndeterminateOverlayPixelsPerSecond = 175; | 532 const int kIndeterminateOverlayPixelsPerSecond = 175; |
533 const int kVistaIndeterminateOverlayWidth = 120; | 533 const int kVistaIndeterminateOverlayWidth = 120; |
534 const int kXPIndeterminateOverlayWidth = 55; | 534 const int kXPIndeterminateOverlayWidth = 55; |
535 // The thickness of the bar frame inside |value_rect| | 535 // The thickness of the bar frame inside |value_rect| |
536 const int kXPBarPadding = 3; | 536 const int kXPBarPadding = 3; |
537 | 537 |
538 bool pre_vista = win_util::GetWinVersion() < win_util::WINVERSION_VISTA; | 538 bool pre_vista = base::win::GetVersion() < base::win::VERSION_VISTA; |
539 HANDLE handle = GetThemeHandle(PROGRESS); | 539 HANDLE handle = GetThemeHandle(PROGRESS); |
540 if (handle && draw_theme_ && draw_theme_ex_) { | 540 if (handle && draw_theme_ && draw_theme_ex_) { |
541 draw_theme_(handle, hdc, PP_BAR, 0, bar_rect, NULL); | 541 draw_theme_(handle, hdc, PP_BAR, 0, bar_rect, NULL); |
542 | 542 |
543 int bar_width = bar_rect->right - bar_rect->left; | 543 int bar_width = bar_rect->right - bar_rect->left; |
544 if (determinate) { | 544 if (determinate) { |
545 // TODO(morrita): this RTL guess can be wrong. | 545 // TODO(morrita): this RTL guess can be wrong. |
546 // We should pass the direction from WebKit side. | 546 // We should pass the direction from WebKit side. |
547 bool is_rtl = (bar_rect->right == value_rect->right && | 547 bool is_rtl = (bar_rect->right == value_rect->right && |
548 bar_rect->left != value_rect->left); | 548 bar_rect->left != value_rect->left); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 handle = open_theme_(NULL, L"Spin"); | 863 handle = open_theme_(NULL, L"Spin"); |
864 break; | 864 break; |
865 default: | 865 default: |
866 NOTREACHED(); | 866 NOTREACHED(); |
867 } | 867 } |
868 theme_handles_[theme_name] = handle; | 868 theme_handles_[theme_name] = handle; |
869 return handle; | 869 return handle; |
870 } | 870 } |
871 | 871 |
872 } // namespace gfx | 872 } // namespace gfx |
OLD | NEW |