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 16 matching lines...) Expand all Loading... |
27 #include "ui/gfx/gdi_util.h" | 27 #include "ui/gfx/gdi_util.h" |
28 #include "ui/gfx/rect.h" | 28 #include "ui/gfx/rect.h" |
29 #include "ui/native_theme/common_theme.h" | 29 #include "ui/native_theme/common_theme.h" |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 // TODO: Obtain the correct colors using GetSysColor. | 33 // TODO: Obtain the correct colors using GetSysColor. |
34 // Theme colors returned by GetSystemColor(). | 34 // Theme colors returned by GetSystemColor(). |
35 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); | 35 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); |
36 // Dialogs: | 36 // Dialogs: |
37 const SkColor kDialogBackgroundColor = SkColorSetRGB(200, 200, 200); | 37 const SkColor kDialogBackgroundColor = SkColorSetRGB(251, 251, 251); |
38 // FocusableBorder: | 38 // FocusableBorder: |
39 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4d, 0x90, 0xfe); | 39 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4d, 0x90, 0xfe); |
40 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xd9, 0xd9, 0xd9); | 40 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xd9, 0xd9, 0xd9); |
41 // TextButton: | 41 // TextButton: |
42 const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xde, 0xde, 0xde); | 42 const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xde, 0xde, 0xde); |
43 const SkColor kTextButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255); | 43 const SkColor kTextButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255); |
44 const SkColor kTextButtonHoverColor = SkColorSetRGB(6, 45, 117); | 44 const SkColor kTextButtonHoverColor = SkColorSetRGB(6, 45, 117); |
45 // MenuItem: | 45 // MenuItem: |
46 const SkColor kEnabledMenuItemForegroundColor = SkColorSetRGB(6, 45, 117); | 46 const SkColor kEnabledMenuItemForegroundColor = SkColorSetRGB(6, 45, 117); |
47 const SkColor kDisabledMenuItemForegroundColor = SkColorSetRGB(161, 161, 146); | 47 const SkColor kDisabledMenuItemForegroundColor = SkColorSetRGB(161, 161, 146); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 return color; | 453 return color; |
454 } | 454 } |
455 | 455 |
456 switch (color_id) { | 456 switch (color_id) { |
457 // Windows | 457 // Windows |
458 case kColorId_WindowBackground: | 458 case kColorId_WindowBackground: |
459 return system_colors_[COLOR_WINDOW]; | 459 return system_colors_[COLOR_WINDOW]; |
460 | 460 |
461 // Dialogs | 461 // Dialogs |
462 case kColorId_DialogBackground: | 462 case kColorId_DialogBackground: |
463 // TODO(benrg): Should this use the new Windows theme functions? The old | 463 return kDialogBackgroundColor; |
464 // code in DialogClientView::OnPaint used GetSysColor(COLOR_3DFACE). | |
465 return system_colors_[COLOR_3DFACE]; | |
466 | 464 |
467 // FocusableBorder | 465 // FocusableBorder |
468 case kColorId_FocusedBorderColor: | 466 case kColorId_FocusedBorderColor: |
469 return kFocusedBorderColor; | 467 return kFocusedBorderColor; |
470 case kColorId_UnfocusedBorderColor: | 468 case kColorId_UnfocusedBorderColor: |
471 return kUnfocusedBorderColor; | 469 return kUnfocusedBorderColor; |
472 | 470 |
473 // TextButton | 471 // TextButton |
474 case kColorId_TextButtonBackgroundColor: | 472 case kColorId_TextButtonBackgroundColor: |
475 return kTextButtonBackgroundColor; | 473 return kTextButtonBackgroundColor; |
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1981 handle = open_theme_(NULL, L"Spin"); | 1979 handle = open_theme_(NULL, L"Spin"); |
1982 break; | 1980 break; |
1983 default: | 1981 default: |
1984 NOTREACHED(); | 1982 NOTREACHED(); |
1985 } | 1983 } |
1986 theme_handles_[theme_name] = handle; | 1984 theme_handles_[theme_name] = handle; |
1987 return handle; | 1985 return handle; |
1988 } | 1986 } |
1989 | 1987 |
1990 } // namespace ui | 1988 } // namespace ui |
OLD | NEW |