| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/native_theme_win.h" | 5 #include "ui/gfx/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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 ReleaseDC(NULL, hdc); | 125 ReleaseDC(NULL, hdc); |
| 126 | 126 |
| 127 return SUCCEEDED(hr) ? Size(size.cx, size.cy) : Size(); | 127 return SUCCEEDED(hr) ? Size(size.cx, size.cy) : Size(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void NativeThemeWin::Paint(SkCanvas* canvas, | 130 void NativeThemeWin::Paint(SkCanvas* canvas, |
| 131 Part part, | 131 Part part, |
| 132 State state, | 132 State state, |
| 133 const gfx::Rect& rect, | 133 const gfx::Rect& rect, |
| 134 const ExtraParams& extra) const { | 134 const ExtraParams& extra) const { |
| 135 if (!skia::SupportsPlatformPaint(canvas)) { |
| 136 // TODO(alokp): Implement this path. |
| 137 // This block will only get hit with --enable-accelerated-drawing flag. |
| 138 DLOG(INFO) << "Could not paint native UI control"; |
| 139 return; |
| 140 } |
| 135 HDC hdc = skia::BeginPlatformPaint(canvas); | 141 HDC hdc = skia::BeginPlatformPaint(canvas); |
| 136 | 142 |
| 137 switch (part) { | 143 switch (part) { |
| 138 case kCheckbox: | 144 case kCheckbox: |
| 139 PaintCheckbox(hdc, part, state, rect, extra.button); | 145 PaintCheckbox(hdc, part, state, rect, extra.button); |
| 140 break; | 146 break; |
| 141 case kRadio: | 147 case kRadio: |
| 142 PaintRadioButton(hdc, part, state, rect, extra.button); | 148 PaintRadioButton(hdc, part, state, rect, extra.button); |
| 143 break; | 149 break; |
| 144 case kPushButton: | 150 case kPushButton: |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 } | 1513 } |
| 1508 break; | 1514 break; |
| 1509 default: | 1515 default: |
| 1510 NOTREACHED() << "Invalid part: " << part; | 1516 NOTREACHED() << "Invalid part: " << part; |
| 1511 break; | 1517 break; |
| 1512 } | 1518 } |
| 1513 return state_id; | 1519 return state_id; |
| 1514 } | 1520 } |
| 1515 | 1521 |
| 1516 } // namespace gfx | 1522 } // namespace gfx |
| OLD | NEW |