Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: content/child/webthemeengine_impl_default.cc

Issue 1461923002: Change name of NativeTheme::instance() to make it clear it's web only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NATIVE_THEME_EXPORT for mac Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/webthemeengine_impl_android.cc ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/child/webthemeengine_impl_default.h" 5 #include "content/child/webthemeengine_impl_default.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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 case ui::NativeTheme::kScrollbarHorizontalTrack: 196 case ui::NativeTheme::kScrollbarHorizontalTrack:
197 case ui::NativeTheme::kScrollbarVerticalTrack: { 197 case ui::NativeTheme::kScrollbarVerticalTrack: {
198 return gfx::Size(g_vertical_scroll_bar_width, 198 return gfx::Size(g_vertical_scroll_bar_width,
199 g_vertical_scroll_bar_width); 199 g_vertical_scroll_bar_width);
200 } 200 }
201 201
202 default: 202 default:
203 break; 203 break;
204 } 204 }
205 #endif 205 #endif
206 return ui::NativeTheme::instance()->GetPartSize(native_theme_part, 206 return ui::NativeTheme::GetInstanceForWeb()->GetPartSize(
207 ui::NativeTheme::kNormal, 207 native_theme_part, ui::NativeTheme::kNormal, extra);
208 extra);
209 } 208 }
210 209
211 void WebThemeEngineImpl::paint( 210 void WebThemeEngineImpl::paint(
212 blink::WebCanvas* canvas, 211 blink::WebCanvas* canvas,
213 WebThemeEngine::Part part, 212 WebThemeEngine::Part part,
214 WebThemeEngine::State state, 213 WebThemeEngine::State state,
215 const blink::WebRect& rect, 214 const blink::WebRect& rect,
216 const WebThemeEngine::ExtraParams* extra_params) { 215 const WebThemeEngine::ExtraParams* extra_params) {
217 ui::NativeTheme::ExtraParams native_theme_extra_params; 216 ui::NativeTheme::ExtraParams native_theme_extra_params;
218 GetNativeThemeExtraParams( 217 GetNativeThemeExtraParams(
219 part, state, extra_params, &native_theme_extra_params); 218 part, state, extra_params, &native_theme_extra_params);
220 ui::NativeTheme::instance()->Paint( 219 ui::NativeTheme::GetInstanceForWeb()->Paint(
221 canvas, 220 canvas, NativeThemePart(part), NativeThemeState(state), gfx::Rect(rect),
222 NativeThemePart(part),
223 NativeThemeState(state),
224 gfx::Rect(rect),
225 native_theme_extra_params); 221 native_theme_extra_params);
226 } 222 }
227 223
228 void WebThemeEngineImpl::paintStateTransition(blink::WebCanvas* canvas, 224 void WebThemeEngineImpl::paintStateTransition(blink::WebCanvas* canvas,
229 WebThemeEngine::Part part, 225 WebThemeEngine::Part part,
230 WebThemeEngine::State startState, 226 WebThemeEngine::State startState,
231 WebThemeEngine::State endState, 227 WebThemeEngine::State endState,
232 double progress, 228 double progress,
233 const blink::WebRect& rect) { 229 const blink::WebRect& rect) {
234 ui::NativeTheme::instance()->PaintStateTransition( 230 ui::NativeTheme::GetInstanceForWeb()->PaintStateTransition(
235 canvas, 231 canvas, NativeThemePart(part), NativeThemeState(startState),
236 NativeThemePart(part), 232 NativeThemeState(endState), progress, gfx::Rect(rect));
237 NativeThemeState(startState),
238 NativeThemeState(endState),
239 progress,
240 gfx::Rect(rect));
241 } 233 }
242 234
243 #if defined(OS_WIN) 235 #if defined(OS_WIN)
244 // static 236 // static
245 void WebThemeEngineImpl::cacheScrollBarMetrics( 237 void WebThemeEngineImpl::cacheScrollBarMetrics(
246 int32 vertical_scroll_bar_width, 238 int32 vertical_scroll_bar_width,
247 int32 horizontal_scroll_bar_height, 239 int32 horizontal_scroll_bar_height,
248 int32 vertical_arrow_bitmap_height, 240 int32 vertical_arrow_bitmap_height,
249 int32 horizontal_arrow_bitmap_width) { 241 int32 horizontal_arrow_bitmap_width) {
250 g_vertical_scroll_bar_width = vertical_scroll_bar_width; 242 g_vertical_scroll_bar_width = vertical_scroll_bar_width;
251 g_horizontal_scroll_bar_height = horizontal_scroll_bar_height; 243 g_horizontal_scroll_bar_height = horizontal_scroll_bar_height;
252 g_vertical_arrow_bitmap_height = vertical_arrow_bitmap_height; 244 g_vertical_arrow_bitmap_height = vertical_arrow_bitmap_height;
253 g_horizontal_arrow_bitmap_width = horizontal_arrow_bitmap_width; 245 g_horizontal_arrow_bitmap_width = horizontal_arrow_bitmap_width;
254 } 246 }
255 #endif 247 #endif
256 248
257 } // namespace content 249 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webthemeengine_impl_android.cc ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698