| 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/base/native_theme/native_theme_win.h" | 5 #include "ui/base/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 15 matching lines...) Expand all Loading... |
| 26 #include "ui/gfx/gdi_util.h" | 26 #include "ui/gfx/gdi_util.h" |
| 27 #include "ui/gfx/rect.h" | 27 #include "ui/gfx/rect.h" |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // TODO: Obtain the correct colors using GetSysColor. | 31 // TODO: Obtain the correct colors using GetSysColor. |
| 32 // Theme colors returned by GetSystemColor(). | 32 // Theme colors returned by GetSystemColor(). |
| 33 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); | 33 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); |
| 34 // Dialogs: | 34 // Dialogs: |
| 35 const SkColor kDialogBackgroundColor = SkColorSetRGB(200, 200, 200); | 35 const SkColor kDialogBackgroundColor = SkColorSetRGB(200, 200, 200); |
| 36 // FocusableBorder (should be unused on Win): | 36 // FocusableBorder: |
| 37 const SkColor kFocusedBorderColor= SkColorSetRGB(0x4D, 0x90, 0xFE); | 37 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); |
| 38 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); | 38 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); |
| 39 // TextButton: | 39 // TextButton: |
| 40 const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xde, 0xde, 0xde); | 40 const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xde, 0xde, 0xde); |
| 41 const SkColor kTextButtonEnabledColor = SkColorSetRGB(6, 45, 117); | 41 const SkColor kTextButtonEnabledColor = SkColorSetRGB(6, 45, 117); |
| 42 const SkColor kTextButtonDisabledColor = SkColorSetRGB(161, 161, 146); | 42 const SkColor kTextButtonDisabledColor = SkColorSetRGB(161, 161, 146); |
| 43 const SkColor kTextButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255); | 43 const SkColor kTextButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255); |
| 44 const SkColor kTextButtonHoverColor = kTextButtonEnabledColor; | 44 const SkColor kTextButtonHoverColor = kTextButtonEnabledColor; |
| 45 // MenuItem: | 45 // MenuItem: |
| 46 const SkColor kEnabledMenuItemForegroundColor = kTextButtonEnabledColor; | 46 const SkColor kEnabledMenuItemForegroundColor = kTextButtonEnabledColor; |
| 47 const SkColor kDisabledMenuItemForegroundColor = kTextButtonDisabledColor; | 47 const SkColor kDisabledMenuItemForegroundColor = kTextButtonDisabledColor; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const { | 379 SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const { |
| 380 switch (color_id) { | 380 switch (color_id) { |
| 381 | 381 |
| 382 // Dialogs | 382 // Dialogs |
| 383 case kColorId_DialogBackground: | 383 case kColorId_DialogBackground: |
| 384 // TODO(benrg): Should this use the new Windows theme functions? The old | 384 // TODO(benrg): Should this use the new Windows theme functions? The old |
| 385 // code in DialogClientView::OnPaint used GetSysColor(COLOR_3DFACE). | 385 // code in DialogClientView::OnPaint used GetSysColor(COLOR_3DFACE). |
| 386 return WinColorToSkColor(GetSysColor(COLOR_3DFACE)); | 386 return WinColorToSkColor(GetSysColor(COLOR_3DFACE)); |
| 387 | 387 |
| 388 // FocusableBorder |
| 389 case kColorId_FocusedBorderColor: |
| 390 return kFocusedBorderColor; |
| 391 case kColorId_UnfocusedBorderColor: |
| 392 return kUnfocusedBorderColor; |
| 393 |
| 388 // TextButton | 394 // TextButton |
| 389 case kColorId_TextButtonBackgroundColor: | 395 case kColorId_TextButtonBackgroundColor: |
| 390 return kTextButtonBackgroundColor; | 396 return kTextButtonBackgroundColor; |
| 391 case kColorId_TextButtonEnabledColor: | 397 case kColorId_TextButtonEnabledColor: |
| 392 return kTextButtonEnabledColor; | 398 return kTextButtonEnabledColor; |
| 393 case kColorId_TextButtonDisabledColor: | 399 case kColorId_TextButtonDisabledColor: |
| 394 return kTextButtonDisabledColor; | 400 return kTextButtonDisabledColor; |
| 395 case kColorId_TextButtonHighlightColor: | 401 case kColorId_TextButtonHighlightColor: |
| 396 return kTextButtonHighlightColor; | 402 return kTextButtonHighlightColor; |
| 397 case kColorId_TextButtonHoverColor: | 403 case kColorId_TextButtonHoverColor: |
| (...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 handle = open_theme_(NULL, L"Spin"); | 1776 handle = open_theme_(NULL, L"Spin"); |
| 1771 break; | 1777 break; |
| 1772 default: | 1778 default: |
| 1773 NOTREACHED(); | 1779 NOTREACHED(); |
| 1774 } | 1780 } |
| 1775 theme_handles_[theme_name] = handle; | 1781 theme_handles_[theme_name] = handle; |
| 1776 return handle; | 1782 return handle; |
| 1777 } | 1783 } |
| 1778 | 1784 |
| 1779 } // namespace ui | 1785 } // namespace ui |
| OLD | NEW |