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 #ifndef UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ | 5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ |
6 #define UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ | 6 #define UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ |
7 | 7 |
8 // A wrapper class for working with custom XP/Vista themes provided in | 8 // A wrapper class for working with custom XP/Vista themes provided in |
9 // uxtheme.dll. This is a singleton class that can be grabbed using | 9 // uxtheme.dll. This is a singleton class that can be grabbed using |
10 // NativeThemeWin::instance(). | 10 // NativeThemeWin::instance(). |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 NativeThemeWin(); | 118 NativeThemeWin(); |
119 ~NativeThemeWin() override; | 119 ~NativeThemeWin() override; |
120 | 120 |
121 private: | 121 private: |
122 // gfx::SysColorChangeListener implementation: | 122 // gfx::SysColorChangeListener implementation: |
123 void OnSysColorChange() override; | 123 void OnSysColorChange() override; |
124 | 124 |
125 // Update the locally cached set of system colors. | 125 // Update the locally cached set of system colors. |
126 void UpdateSystemColors(); | 126 void UpdateSystemColors(); |
127 | 127 |
128 // Paint directly to canvas' HDC. | 128 // Paint directly to HDC. |
129 void PaintDirect(SkCanvas* canvas, | 129 void PaintDirect(HDC hdc, |
130 Part part, | 130 Part part, |
131 State state, | 131 State state, |
132 const gfx::Rect& rect, | 132 const gfx::Rect& rect, |
133 const ExtraParams& extra) const; | 133 const ExtraParams& extra) const; |
134 | 134 |
135 // Create a temporary HDC, paint to that, clean up the alpha values in the | 135 // Create a temporary HDC, paint to that, clean up the alpha values in the |
136 // temporary HDC, and then blit the result to canvas. This is to work around | 136 // temporary HDC, and then blit the result to canvas. This is to work around |
137 // the fact that Windows XP and some classic themes give bogus alpha values. | 137 // the fact that Windows XP and some classic themes give bogus alpha values. |
138 void PaintIndirect(SkCanvas* canvas, | 138 void PaintIndirect(HDC hdc, |
139 Part part, | 139 Part part, |
140 State state, | 140 State state, |
141 const gfx::Rect& rect, | 141 const gfx::Rect& rect, |
142 const ExtraParams& extra) const; | 142 const ExtraParams& extra) const; |
143 | 143 |
144 HRESULT GetThemePartSize(ThemeName themeName, | 144 HRESULT GetThemePartSize(ThemeName themeName, |
145 HDC hdc, | 145 HDC hdc, |
146 int part_id, | 146 int part_id, |
147 int state_id, | 147 int state_id, |
148 RECT* rect, | 148 RECT* rect, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 HRESULT PaintScrollbarThumb(HDC hdc, | 219 HRESULT PaintScrollbarThumb(HDC hdc, |
220 Part part, | 220 Part part, |
221 State state, | 221 State state, |
222 const gfx::Rect& rect, | 222 const gfx::Rect& rect, |
223 const ScrollbarThumbExtraParams& extra) const; | 223 const ScrollbarThumbExtraParams& extra) const; |
224 | 224 |
225 // This method is deprecated and will be removed in the near future. | 225 // This method is deprecated and will be removed in the near future. |
226 // Paints a scrollbar track section. |align_rect| is only used in classic | 226 // Paints a scrollbar track section. |align_rect| is only used in classic |
227 // mode, and makes sure the checkerboard pattern in |target_rect| is aligned | 227 // mode, and makes sure the checkerboard pattern in |target_rect| is aligned |
228 // with one presumed to be in |align_rect|. | 228 // with one presumed to be in |align_rect|. |
229 HRESULT PaintScrollbarTrack(SkCanvas* canvas, | 229 HRESULT PaintScrollbarTrack(HDC hdc, |
230 HDC hdc, | |
231 Part part, | 230 Part part, |
232 State state, | 231 State state, |
233 const gfx::Rect& rect, | 232 const gfx::Rect& rect, |
234 const ScrollbarTrackExtraParams& extra) const; | 233 const ScrollbarTrackExtraParams& extra) const; |
235 | 234 |
236 HRESULT PaintSpinButton(HDC hdc, | 235 HRESULT PaintSpinButton(HDC hdc, |
237 Part part, | 236 Part part, |
238 State state, | 237 State state, |
239 const gfx::Rect& rect, | 238 const gfx::Rect& rect, |
240 const InnerSpinButtonExtraParams& extra) const; | 239 const InnerSpinButtonExtraParams& extra) const; |
241 | 240 |
242 HRESULT PaintTrackbar(SkCanvas* canvas, | 241 HRESULT PaintTrackbar(HDC hdc, |
243 HDC hdc, | |
244 Part part, | 242 Part part, |
245 State state, | 243 State state, |
246 const gfx::Rect& rect, | 244 const gfx::Rect& rect, |
247 const TrackbarExtraParams& extra) const; | 245 const TrackbarExtraParams& extra) const; |
248 | 246 |
249 HRESULT PaintProgressBar(HDC hdc, | 247 HRESULT PaintProgressBar(HDC hdc, |
250 const gfx::Rect& rect, | 248 const gfx::Rect& rect, |
251 const ProgressBarExtraParams& extra) const; | 249 const ProgressBarExtraParams& extra) const; |
252 | 250 |
253 HRESULT PaintWindowResizeGripper(HDC hdc, const gfx::Rect& rect) const; | 251 HRESULT PaintWindowResizeGripper(HDC hdc, const gfx::Rect& rect) const; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 362 |
365 // Is |is_using_high_contrast_| valid? | 363 // Is |is_using_high_contrast_| valid? |
366 mutable bool is_using_high_contrast_valid_; | 364 mutable bool is_using_high_contrast_valid_; |
367 | 365 |
368 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); | 366 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); |
369 }; | 367 }; |
370 | 368 |
371 } // namespace ui | 369 } // namespace ui |
372 | 370 |
373 #endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ | 371 #endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ |
OLD | NEW |