Chromium Code Reviews| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <uxtheme.h> | 9 #include <uxtheme.h> |
| 10 #include <vsstyle.h> | 10 #include <vsstyle.h> |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 PaintMenuBackground(canvas, rect); | 272 PaintMenuBackground(canvas, rect); |
| 273 return; | 273 return; |
| 274 case kMenuItemBackground: | 274 case kMenuItemBackground: |
| 275 CommonThemePaintMenuItemBackground(this, canvas, state, rect, | 275 CommonThemePaintMenuItemBackground(this, canvas, state, rect, |
| 276 extra.menu_item); | 276 extra.menu_item); |
| 277 return; | 277 return; |
| 278 default: | 278 default: |
| 279 break; | 279 break; |
| 280 } | 280 } |
| 281 | 281 |
| 282 HDC surface = skia::GetNativeDrawingContext(canvas); | 282 PaintIndirect(canvas, part, state, rect, extra); |
|
Peter Kasting
2017/02/24 23:10:10
Nit: Now that this call is so simple, I suggest mo
enne (OOO)
2017/02/24 23:23:12
Done.
| |
| 283 | |
| 284 // When drawing the task manager or the bookmark editor, we draw into an | |
| 285 // offscreen buffer, where we can use OS-specific drawing routines for | |
| 286 // UI features like scrollbars. However, we need to set up that buffer, | |
| 287 // and then read it back when it's done and blit it onto the screen. | |
| 288 | |
| 289 if (surface) | |
| 290 PaintDirect(canvas, surface, part, state, rect, extra); | |
| 291 else | |
| 292 PaintIndirect(canvas, part, state, rect, extra); | |
| 293 } | 283 } |
| 294 | 284 |
| 295 NativeThemeWin::NativeThemeWin() | 285 NativeThemeWin::NativeThemeWin() |
| 296 : draw_theme_(NULL), | 286 : draw_theme_(NULL), |
| 297 draw_theme_ex_(NULL), | 287 draw_theme_ex_(NULL), |
| 298 get_theme_color_(NULL), | 288 get_theme_color_(NULL), |
| 299 get_theme_content_rect_(NULL), | 289 get_theme_content_rect_(NULL), |
| 300 get_theme_part_size_(NULL), | 290 get_theme_part_size_(NULL), |
| 301 open_theme_(NULL), | 291 open_theme_(NULL), |
| 302 close_theme_(NULL), | 292 close_theme_(NULL), |
| (...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2101 break; | 2091 break; |
| 2102 case LAST: | 2092 case LAST: |
| 2103 NOTREACHED(); | 2093 NOTREACHED(); |
| 2104 break; | 2094 break; |
| 2105 } | 2095 } |
| 2106 theme_handles_[theme_name] = handle; | 2096 theme_handles_[theme_name] = handle; |
| 2107 return handle; | 2097 return handle; |
| 2108 } | 2098 } |
| 2109 | 2099 |
| 2110 } // namespace ui | 2100 } // namespace ui |
| OLD | NEW |