OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/html_viewer/web_theme_engine_impl.h" | 5 #include "components/html_viewer/web_theme_engine_impl.h" |
6 | 6 |
7 #include "skia/ext/platform_canvas.h" | 7 #include "skia/ext/platform_canvas.h" |
8 #include "third_party/WebKit/public/platform/WebRect.h" | 8 #include "third_party/WebKit/public/platform/WebRect.h" |
9 #include "third_party/WebKit/public/platform/WebSize.h" | 9 #include "third_party/WebKit/public/platform/WebSize.h" |
10 #include "ui/native_theme/native_theme.h" | 10 #include "ui/native_theme/native_theme.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 break; | 160 break; |
161 default: | 161 default: |
162 break; // Parts that have no extra params get here. | 162 break; // Parts that have no extra params get here. |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 } // namespace | 166 } // namespace |
167 | 167 |
168 blink::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) { | 168 blink::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) { |
169 ui::NativeTheme::ExtraParams extra; | 169 ui::NativeTheme::ExtraParams extra; |
170 return ui::NativeTheme::instance()->GetPartSize(NativeThemePart(part), | 170 return ui::NativeTheme::GetInstanceForWeb()->GetPartSize( |
171 ui::NativeTheme::kNormal, | 171 NativeThemePart(part), ui::NativeTheme::kNormal, extra); |
172 extra); | |
173 } | 172 } |
174 | 173 |
175 void WebThemeEngineImpl::paint( | 174 void WebThemeEngineImpl::paint( |
176 blink::WebCanvas* canvas, | 175 blink::WebCanvas* canvas, |
177 WebThemeEngine::Part part, | 176 WebThemeEngine::Part part, |
178 WebThemeEngine::State state, | 177 WebThemeEngine::State state, |
179 const blink::WebRect& rect, | 178 const blink::WebRect& rect, |
180 const WebThemeEngine::ExtraParams* extra_params) { | 179 const WebThemeEngine::ExtraParams* extra_params) { |
181 ui::NativeTheme::ExtraParams native_theme_extra_params; | 180 ui::NativeTheme::ExtraParams native_theme_extra_params; |
182 GetNativeThemeExtraParams( | 181 GetNativeThemeExtraParams( |
183 part, state, extra_params, &native_theme_extra_params); | 182 part, state, extra_params, &native_theme_extra_params); |
184 ui::NativeTheme::instance()->Paint( | 183 ui::NativeTheme::GetInstanceForWeb()->Paint( |
185 canvas, | 184 canvas, NativeThemePart(part), NativeThemeState(state), gfx::Rect(rect), |
186 NativeThemePart(part), | |
187 NativeThemeState(state), | |
188 gfx::Rect(rect), | |
189 native_theme_extra_params); | 185 native_theme_extra_params); |
190 } | 186 } |
191 | 187 |
192 void WebThemeEngineImpl::paintStateTransition(blink::WebCanvas* canvas, | 188 void WebThemeEngineImpl::paintStateTransition(blink::WebCanvas* canvas, |
193 WebThemeEngine::Part part, | 189 WebThemeEngine::Part part, |
194 WebThemeEngine::State startState, | 190 WebThemeEngine::State startState, |
195 WebThemeEngine::State endState, | 191 WebThemeEngine::State endState, |
196 double progress, | 192 double progress, |
197 const blink::WebRect& rect) { | 193 const blink::WebRect& rect) { |
198 ui::NativeTheme::instance()->PaintStateTransition( | 194 ui::NativeTheme::GetInstanceForWeb()->PaintStateTransition( |
199 canvas, | 195 canvas, NativeThemePart(part), NativeThemeState(startState), |
200 NativeThemePart(part), | 196 NativeThemeState(endState), progress, gfx::Rect(rect)); |
201 NativeThemeState(startState), | |
202 NativeThemeState(endState), | |
203 progress, | |
204 gfx::Rect(rect)); | |
205 } | 197 } |
206 | 198 |
207 } // namespace html_viewer | 199 } // namespace html_viewer |
OLD | NEW |