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 "content/child/webthemeengine_impl_android.h" | 5 #include "content/child/webthemeengine_impl_android.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
9 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
10 #include "third_party/WebKit/public/platform/WebRect.h" | 10 #include "third_party/WebKit/public/platform/WebRect.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 blink::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) { | 169 blink::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) { |
170 ui::NativeTheme::ExtraParams extra; | 170 ui::NativeTheme::ExtraParams extra; |
171 return ui::NativeTheme::GetInstanceForWeb()->GetPartSize( | 171 return ui::NativeTheme::GetInstanceForWeb()->GetPartSize( |
172 NativeThemePart(part), ui::NativeTheme::kNormal, extra); | 172 NativeThemePart(part), ui::NativeTheme::kNormal, extra); |
173 } | 173 } |
174 | 174 |
175 void WebThemeEngineImpl::getOverlayScrollbarStyle(ScrollbarStyle* style) { | 175 void WebThemeEngineImpl::getOverlayScrollbarStyle(ScrollbarStyle* style) { |
176 // TODO(bokan): Android scrollbars on non-composited scrollers don't | |
177 // currently fade out so the fadeOutDuration and Delay Now that this has | |
178 // been added into Blink for other platforms we should plumb that through for | |
179 // Android as well. | |
180 if (getMajorVersion() >= kVersionLollipop) { | 176 if (getMajorVersion() >= kVersionLollipop) { |
181 style->thumbThickness = 4; | 177 style->thumbThickness = 4; |
182 style->scrollbarMargin = 0; | 178 style->scrollbarMargin = 0; |
183 style->color = SkColorSetARGB(128, 64, 64, 64); | 179 style->color = SkColorSetARGB(128, 64, 64, 64); |
184 } else { | 180 } else { |
185 style->thumbThickness = 3; | 181 style->thumbThickness = 3; |
186 style->scrollbarMargin = 3; | 182 style->scrollbarMargin = 3; |
187 style->color = SkColorSetARGB(128, 128, 128, 128); | 183 style->color = SkColorSetARGB(128, 128, 128, 128); |
188 } | 184 } |
189 } | 185 } |
190 | 186 |
191 void WebThemeEngineImpl::paint( | 187 void WebThemeEngineImpl::paint( |
192 blink::WebCanvas* canvas, | 188 blink::WebCanvas* canvas, |
193 WebThemeEngine::Part part, | 189 WebThemeEngine::Part part, |
194 WebThemeEngine::State state, | 190 WebThemeEngine::State state, |
195 const blink::WebRect& rect, | 191 const blink::WebRect& rect, |
196 const WebThemeEngine::ExtraParams* extra_params) { | 192 const WebThemeEngine::ExtraParams* extra_params) { |
197 ui::NativeTheme::ExtraParams native_theme_extra_params; | 193 ui::NativeTheme::ExtraParams native_theme_extra_params; |
198 GetNativeThemeExtraParams( | 194 GetNativeThemeExtraParams( |
199 part, state, extra_params, &native_theme_extra_params); | 195 part, state, extra_params, &native_theme_extra_params); |
200 ui::NativeTheme::GetInstanceForWeb()->Paint( | 196 ui::NativeTheme::GetInstanceForWeb()->Paint( |
201 canvas, NativeThemePart(part), NativeThemeState(state), gfx::Rect(rect), | 197 canvas, NativeThemePart(part), NativeThemeState(state), gfx::Rect(rect), |
202 native_theme_extra_params); | 198 native_theme_extra_params); |
203 } | 199 } |
204 } // namespace content | 200 } // namespace content |
OLD | NEW |