| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // consistent visual results. | 84 // consistent visual results. |
| 85 void DisableTheming() const; | 85 void DisableTheming() const; |
| 86 | 86 |
| 87 // Closes cached theme handles so we can unload the DLL or update our UI | 87 // Closes cached theme handles so we can unload the DLL or update our UI |
| 88 // for a theme change. | 88 // for a theme change. |
| 89 void CloseHandles() const; | 89 void CloseHandles() const; |
| 90 | 90 |
| 91 // Returns true if classic theme is in use. | 91 // Returns true if classic theme is in use. |
| 92 bool IsClassicTheme(ThemeName name) const; | 92 bool IsClassicTheme(ThemeName name) const; |
| 93 | 93 |
| 94 // Gets our singleton instance. | |
| 95 static NativeThemeWin* instance(); | |
| 96 | |
| 97 HRESULT PaintTextField(HDC hdc, | 94 HRESULT PaintTextField(HDC hdc, |
| 98 int part_id, | 95 int part_id, |
| 99 int state_id, | 96 int state_id, |
| 100 int classic_state, | 97 int classic_state, |
| 101 RECT* rect, | 98 RECT* rect, |
| 102 COLORREF color, | 99 COLORREF color, |
| 103 bool fill_content_area, | 100 bool fill_content_area, |
| 104 bool draw_edges) const; | 101 bool draw_edges) const; |
| 105 | 102 |
| 106 // NativeTheme implementation: | 103 // NativeTheme implementation: |
| 107 gfx::Size GetPartSize(Part part, | 104 gfx::Size GetPartSize(Part part, |
| 108 State state, | 105 State state, |
| 109 const ExtraParams& extra) const override; | 106 const ExtraParams& extra) const override; |
| 110 void Paint(SkCanvas* canvas, | 107 void Paint(SkCanvas* canvas, |
| 111 Part part, | 108 Part part, |
| 112 State state, | 109 State state, |
| 113 const gfx::Rect& rect, | 110 const gfx::Rect& rect, |
| 114 const ExtraParams& extra) const override; | 111 const ExtraParams& extra) const override; |
| 115 SkColor GetSystemColor(ColorId color_id) const override; | 112 SkColor GetSystemColor(ColorId color_id) const override; |
| 116 | 113 |
| 117 protected: | 114 protected: |
| 115 friend class NativeTheme; |
| 116 // Gets our singleton instance. |
| 117 static NativeThemeWin* instance(); |
| 118 |
| 118 NativeThemeWin(); | 119 NativeThemeWin(); |
| 119 ~NativeThemeWin() override; | 120 ~NativeThemeWin() override; |
| 120 | 121 |
| 121 private: | 122 private: |
| 122 // gfx::SysColorChangeListener implementation: | 123 // gfx::SysColorChangeListener implementation: |
| 123 void OnSysColorChange() override; | 124 void OnSysColorChange() override; |
| 124 | 125 |
| 125 // Update the locally cached set of system colors. | 126 // Update the locally cached set of system colors. |
| 126 void UpdateSystemColors(); | 127 void UpdateSystemColors(); |
| 127 | 128 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 372 |
| 372 // Is |is_using_high_contrast_| valid? | 373 // Is |is_using_high_contrast_| valid? |
| 373 mutable bool is_using_high_contrast_valid_; | 374 mutable bool is_using_high_contrast_valid_; |
| 374 | 375 |
| 375 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); | 376 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); |
| 376 }; | 377 }; |
| 377 | 378 |
| 378 } // namespace ui | 379 } // namespace ui |
| 379 | 380 |
| 380 #endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ | 381 #endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ |
| OLD | NEW |