| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Painting functions that paint to SkCanvas. | 128 // Painting functions that paint to SkCanvas. |
| 129 void PaintMenuSeparator(SkCanvas* canvas, const gfx::Rect& rect) const; | 129 void PaintMenuSeparator(SkCanvas* canvas, const gfx::Rect& rect) const; |
| 130 void PaintMenuGutter(SkCanvas* canvas, const gfx::Rect& rect) const; | 130 void PaintMenuGutter(SkCanvas* canvas, const gfx::Rect& rect) const; |
| 131 void PaintMenuBackground(SkCanvas* canvas, const gfx::Rect& rect) const; | 131 void PaintMenuBackground(SkCanvas* canvas, const gfx::Rect& rect) const; |
| 132 | 132 |
| 133 // Paint directly to canvas' HDC. |
| 134 void PaintDirect(SkCanvas* canvas, |
| 135 Part part, |
| 136 State state, |
| 137 const gfx::Rect& rect, |
| 138 const ExtraParams& extra) const; |
| 139 |
| 140 // Create a temporary HDC, paint to that, clean up the alpha values in the |
| 141 // temporary HDC, and then blit the result to canvas. This is to work around |
| 142 // the fact that Windows XP and some classic themes give bogus alpha values. |
| 143 void PaintIndirect(SkCanvas* canvas, |
| 144 Part part, |
| 145 State state, |
| 146 const gfx::Rect& rect, |
| 147 const ExtraParams& extra) const; |
| 148 |
| 133 HRESULT GetThemePartSize(ThemeName themeName, | 149 HRESULT GetThemePartSize(ThemeName themeName, |
| 134 HDC hdc, | 150 HDC hdc, |
| 135 int part_id, | 151 int part_id, |
| 136 int state_id, | 152 int state_id, |
| 137 RECT* rect, | 153 RECT* rect, |
| 138 int ts, | 154 int ts, |
| 139 SIZE* size) const; | 155 SIZE* size) const; |
| 140 | 156 |
| 141 HRESULT PaintButton(HDC hdc, | 157 HRESULT PaintButton(HDC hdc, |
| 142 State state, | 158 State state, |
| 143 const ButtonExtraParams& extra, | 159 const ButtonExtraParams& extra, |
| 144 int part_id, | 160 int part_id, |
| 145 int state_id, | 161 int state_id, |
| 146 RECT* rect) const; | 162 RECT* rect) const; |
| 147 | 163 |
| 164 HRESULT PaintMenuSeparator(HDC hdc, |
| 165 const gfx::Rect& rect) const; |
| 166 |
| 167 HRESULT PaintMenuGutter(HDC hdc, const gfx::Rect& rect) const; |
| 168 |
| 148 // |arrow_direction| determines whether the arrow is pointing to the left or | 169 // |arrow_direction| determines whether the arrow is pointing to the left or |
| 149 // to the right. In RTL locales, sub-menus open from right to left and | 170 // to the right. In RTL locales, sub-menus open from right to left and |
| 150 // therefore the menu arrow should point to the left and not to the right. | 171 // therefore the menu arrow should point to the left and not to the right. |
| 151 HRESULT PaintMenuArrow(HDC hdc, | 172 HRESULT PaintMenuArrow(HDC hdc, |
| 152 State state, | 173 State state, |
| 153 const gfx::Rect& rect, | 174 const gfx::Rect& rect, |
| 154 const MenuArrowExtraParams& extra) const; | 175 const MenuArrowExtraParams& extra) const; |
| 155 | 176 |
| 177 HRESULT PaintMenuBackground(HDC hdc, const gfx::Rect& rect) const; |
| 178 |
| 156 HRESULT PaintMenuCheck(HDC hdc, | 179 HRESULT PaintMenuCheck(HDC hdc, |
| 157 State state, | 180 State state, |
| 158 const gfx::Rect& rect, | 181 const gfx::Rect& rect, |
| 159 const MenuCheckExtraParams& extra) const; | 182 const MenuCheckExtraParams& extra) const; |
| 160 | 183 |
| 161 HRESULT PaintMenuCheckBackground(HDC hdc, | 184 HRESULT PaintMenuCheckBackground(HDC hdc, |
| 162 State state, | 185 State state, |
| 163 const gfx::Rect& rect) const; | 186 const gfx::Rect& rect) const; |
| 164 | 187 |
| 188 HRESULT PaintMenuItemBackground(HDC hdc, |
| 189 State state, |
| 190 const gfx::Rect& rect, |
| 191 const MenuItemExtraParams& extra) const; |
| 192 |
| 165 HRESULT PaintPushButton(HDC hdc, | 193 HRESULT PaintPushButton(HDC hdc, |
| 166 Part part, | 194 Part part, |
| 167 State state, | 195 State state, |
| 168 const gfx::Rect& rect, | 196 const gfx::Rect& rect, |
| 169 const ButtonExtraParams& extra) const; | 197 const ButtonExtraParams& extra) const; |
| 170 | 198 |
| 171 HRESULT PaintRadioButton(HDC hdc, | 199 HRESULT PaintRadioButton(HDC hdc, |
| 172 Part part, | 200 Part part, |
| 173 State state, | 201 State state, |
| 174 const gfx::Rect& rect, | 202 const gfx::Rect& rect, |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 369 |
| 342 // Is |is_using_high_contrast_| valid? | 370 // Is |is_using_high_contrast_| valid? |
| 343 mutable bool is_using_high_contrast_valid_; | 371 mutable bool is_using_high_contrast_valid_; |
| 344 | 372 |
| 345 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); | 373 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); |
| 346 }; | 374 }; |
| 347 | 375 |
| 348 } // namespace ui | 376 } // namespace ui |
| 349 | 377 |
| 350 #endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ | 378 #endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ |
| OLD | NEW |