| 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 "webkit/child/webthemeengine_impl_default.h" | 5 #include "webkit/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" |
| 11 | 11 |
| 12 using WebKit::WebCanvas; | 12 using blink::WebCanvas; |
| 13 using WebKit::WebColor; | 13 using blink::WebColor; |
| 14 using WebKit::WebRect; | 14 using blink::WebRect; |
| 15 using WebKit::WebThemeEngine; | 15 using blink::WebThemeEngine; |
| 16 | 16 |
| 17 namespace webkit_glue { | 17 namespace webkit_glue { |
| 18 | 18 |
| 19 static ui::NativeTheme::Part NativeThemePart( | 19 static ui::NativeTheme::Part NativeThemePart( |
| 20 WebThemeEngine::Part part) { | 20 WebThemeEngine::Part part) { |
| 21 switch (part) { | 21 switch (part) { |
| 22 case WebThemeEngine::PartScrollbarDownArrow: | 22 case WebThemeEngine::PartScrollbarDownArrow: |
| 23 return ui::NativeTheme::kScrollbarDownArrow; | 23 return ui::NativeTheme::kScrollbarDownArrow; |
| 24 case WebThemeEngine::PartScrollbarLeftArrow: | 24 case WebThemeEngine::PartScrollbarLeftArrow: |
| 25 return ui::NativeTheme::kScrollbarLeftArrow; | 25 return ui::NativeTheme::kScrollbarLeftArrow; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 native_theme_extra_params->progress_bar.value_rect_width = | 151 native_theme_extra_params->progress_bar.value_rect_width = |
| 152 extra_params->progressBar.valueRectWidth; | 152 extra_params->progressBar.valueRectWidth; |
| 153 native_theme_extra_params->progress_bar.value_rect_height = | 153 native_theme_extra_params->progress_bar.value_rect_height = |
| 154 extra_params->progressBar.valueRectHeight; | 154 extra_params->progressBar.valueRectHeight; |
| 155 break; | 155 break; |
| 156 default: | 156 default: |
| 157 break; // Parts that have no extra params get here. | 157 break; // Parts that have no extra params get here. |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 WebKit::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) { | 161 blink::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) { |
| 162 ui::NativeTheme::ExtraParams extra; | 162 ui::NativeTheme::ExtraParams extra; |
| 163 return ui::NativeTheme::instance()->GetPartSize(NativeThemePart(part), | 163 return ui::NativeTheme::instance()->GetPartSize(NativeThemePart(part), |
| 164 ui::NativeTheme::kNormal, | 164 ui::NativeTheme::kNormal, |
| 165 extra); | 165 extra); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void WebThemeEngineImpl::paint( | 168 void WebThemeEngineImpl::paint( |
| 169 WebKit::WebCanvas* canvas, | 169 blink::WebCanvas* canvas, |
| 170 WebThemeEngine::Part part, | 170 WebThemeEngine::Part part, |
| 171 WebThemeEngine::State state, | 171 WebThemeEngine::State state, |
| 172 const WebKit::WebRect& rect, | 172 const blink::WebRect& rect, |
| 173 const WebThemeEngine::ExtraParams* extra_params) { | 173 const WebThemeEngine::ExtraParams* extra_params) { |
| 174 ui::NativeTheme::ExtraParams native_theme_extra_params; | 174 ui::NativeTheme::ExtraParams native_theme_extra_params; |
| 175 GetNativeThemeExtraParams( | 175 GetNativeThemeExtraParams( |
| 176 part, state, extra_params, &native_theme_extra_params); | 176 part, state, extra_params, &native_theme_extra_params); |
| 177 ui::NativeTheme::instance()->Paint( | 177 ui::NativeTheme::instance()->Paint( |
| 178 canvas, | 178 canvas, |
| 179 NativeThemePart(part), | 179 NativeThemePart(part), |
| 180 NativeThemeState(state), | 180 NativeThemeState(state), |
| 181 gfx::Rect(rect), | 181 gfx::Rect(rect), |
| 182 native_theme_extra_params); | 182 native_theme_extra_params); |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace webkit_glue | 185 } // namespace webkit_glue |
| OLD | NEW |