OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // A wrapper class for working with custom XP/Vista themes provided in | 5 // A wrapper class for working with custom XP/Vista themes provided in |
6 // uxtheme.dll. This is a singleton class that can be grabbed using | 6 // uxtheme.dll. This is a singleton class that can be grabbed using |
7 // NativeThemeWin::instance(). | 7 // NativeThemeWin::instance(). |
8 // For more information on visual style parts and states, see: | 8 // For more information on visual style parts and states, see: |
9 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/plat
form/commctls/userex/topics/partsandstates.asp | 9 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/plat
form/commctls/userex/topics/partsandstates.asp |
10 | 10 |
11 #ifndef UI_GFX_NATIVE_THEME_WIN_H_ | 11 #ifndef UI_GFX_NATIVE_THEME_WIN_H_ |
12 #define UI_GFX_NATIVE_THEME_WIN_H_ | 12 #define UI_GFX_NATIVE_THEME_WIN_H_ |
13 #pragma once | 13 #pragma once |
14 | 14 |
15 #include <windows.h> | 15 #include <windows.h> |
16 #include <uxtheme.h> | 16 #include <uxtheme.h> |
17 | 17 |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| 19 #include "base/compiler_specific.h" |
19 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
20 #include "ui/gfx/native_theme.h" | 21 #include "ui/gfx/native_theme.h" |
21 #include "ui/gfx/size.h" | 22 #include "ui/gfx/size.h" |
22 | 23 |
23 class SkCanvas; | 24 class SkCanvas; |
24 | 25 |
25 namespace gfx { | 26 namespace gfx { |
26 | 27 |
27 // Windows implementation of native theme class. | 28 // Windows implementation of native theme class. |
28 // | 29 // |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 90 |
90 HRESULT PaintTextField(HDC hdc, | 91 HRESULT PaintTextField(HDC hdc, |
91 int part_id, | 92 int part_id, |
92 int state_id, | 93 int state_id, |
93 int classic_state, | 94 int classic_state, |
94 RECT* rect, | 95 RECT* rect, |
95 COLORREF color, | 96 COLORREF color, |
96 bool fill_content_area, | 97 bool fill_content_area, |
97 bool draw_edges) const; | 98 bool draw_edges) const; |
98 | 99 |
| 100 virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE; |
| 101 |
99 private: | 102 private: |
100 NativeThemeWin(); | 103 NativeThemeWin(); |
101 ~NativeThemeWin(); | 104 ~NativeThemeWin(); |
102 | 105 |
103 // NativeTheme Implementation: | 106 // NativeTheme Implementation: |
104 virtual gfx::Size GetPartSize(Part part, | 107 virtual gfx::Size GetPartSize(Part part, |
105 State state, | 108 State state, |
106 const ExtraParams& extra) const; | 109 const ExtraParams& extra) const OVERRIDE; |
107 virtual void Paint(SkCanvas* canvas, | 110 virtual void Paint(SkCanvas* canvas, |
108 Part part, | 111 Part part, |
109 State state, | 112 State state, |
110 const gfx::Rect& rect, | 113 const gfx::Rect& rect, |
111 const ExtraParams& extra) const; | 114 const ExtraParams& extra) const OVERRIDE; |
112 | 115 |
113 void PaintToNonPlatformCanvas(SkCanvas* canvas, | 116 void PaintToNonPlatformCanvas(SkCanvas* canvas, |
114 Part part, | 117 Part part, |
115 State state, | 118 State state, |
116 const gfx::Rect& rect, | 119 const gfx::Rect& rect, |
117 const ExtraParams& extra) const; | 120 const ExtraParams& extra) const; |
118 | 121 |
119 HRESULT GetThemePartSize(ThemeName themeName, | 122 HRESULT GetThemePartSize(ThemeName themeName, |
120 HDC hdc, | 123 HDC hdc, |
121 int part_id, | 124 int part_id, |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 323 |
321 // A cache of open theme handles. | 324 // A cache of open theme handles. |
322 mutable HANDLE theme_handles_[LAST]; | 325 mutable HANDLE theme_handles_[LAST]; |
323 | 326 |
324 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); | 327 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); |
325 }; | 328 }; |
326 | 329 |
327 } // namespace gfx | 330 } // namespace gfx |
328 | 331 |
329 #endif // UI_GFX_NATIVE_THEME_WIN_H_ | 332 #endif // UI_GFX_NATIVE_THEME_WIN_H_ |
OLD | NEW |