| 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/native_theme/native_theme_win.h" | 5 #include "ui/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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 if (needs_paint_indirect) | 291 if (needs_paint_indirect) |
| 292 PaintIndirect(canvas, part, state, rect, extra); | 292 PaintIndirect(canvas, part, state, rect, extra); |
| 293 else | 293 else |
| 294 PaintDirect(canvas, part, state, rect, extra); | 294 PaintDirect(canvas, part, state, rect, extra); |
| 295 } | 295 } |
| 296 | 296 |
| 297 NativeThemeWin::NativeThemeWin() | 297 NativeThemeWin::NativeThemeWin() |
| 298 : theme_dll_(LoadLibrary(L"uxtheme.dll")), | 298 : draw_theme_(NULL), |
| 299 draw_theme_(NULL), | |
| 300 draw_theme_ex_(NULL), | 299 draw_theme_ex_(NULL), |
| 301 get_theme_color_(NULL), | 300 get_theme_color_(NULL), |
| 302 get_theme_content_rect_(NULL), | 301 get_theme_content_rect_(NULL), |
| 303 get_theme_part_size_(NULL), | 302 get_theme_part_size_(NULL), |
| 304 open_theme_(NULL), | 303 open_theme_(NULL), |
| 305 close_theme_(NULL), | 304 close_theme_(NULL), |
| 306 set_theme_properties_(NULL), | 305 set_theme_properties_(NULL), |
| 307 is_theme_active_(NULL), | 306 is_theme_active_(NULL), |
| 308 get_theme_int_(NULL), | 307 get_theme_int_(NULL), |
| 308 theme_dll_(LoadLibrary(L"uxtheme.dll")), |
| 309 color_change_listener_(this), | 309 color_change_listener_(this), |
| 310 is_using_high_contrast_(false), | 310 is_using_high_contrast_(false), |
| 311 is_using_high_contrast_valid_(false) { | 311 is_using_high_contrast_valid_(false) { |
| 312 if (theme_dll_) { | 312 if (theme_dll_) { |
| 313 draw_theme_ = reinterpret_cast<DrawThemeBackgroundPtr>( | 313 draw_theme_ = reinterpret_cast<DrawThemeBackgroundPtr>( |
| 314 GetProcAddress(theme_dll_, "DrawThemeBackground")); | 314 GetProcAddress(theme_dll_, "DrawThemeBackground")); |
| 315 draw_theme_ex_ = reinterpret_cast<DrawThemeBackgroundExPtr>( | 315 draw_theme_ex_ = reinterpret_cast<DrawThemeBackgroundExPtr>( |
| 316 GetProcAddress(theme_dll_, "DrawThemeBackgroundEx")); | 316 GetProcAddress(theme_dll_, "DrawThemeBackgroundEx")); |
| 317 get_theme_color_ = reinterpret_cast<GetThemeColorPtr>( | 317 get_theme_color_ = reinterpret_cast<GetThemeColorPtr>( |
| 318 GetProcAddress(theme_dll_, "GetThemeColor")); | 318 GetProcAddress(theme_dll_, "GetThemeColor")); |
| (...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 break; | 2084 break; |
| 2085 case LAST: | 2085 case LAST: |
| 2086 NOTREACHED(); | 2086 NOTREACHED(); |
| 2087 break; | 2087 break; |
| 2088 } | 2088 } |
| 2089 theme_handles_[theme_name] = handle; | 2089 theme_handles_[theme_name] = handle; |
| 2090 return handle; | 2090 return handle; |
| 2091 } | 2091 } |
| 2092 | 2092 |
| 2093 } // namespace ui | 2093 } // namespace ui |
| OLD | NEW |