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. |
176 if (getMajorVersion() >= kVersionLollipop) { | 180 if (getMajorVersion() >= kVersionLollipop) { |
177 style->thumbThickness = 4; | 181 style->thumbThickness = 4; |
178 style->scrollbarMargin = 0; | 182 style->scrollbarMargin = 0; |
179 style->color = SkColorSetARGB(128, 64, 64, 64); | 183 style->color = SkColorSetARGB(128, 64, 64, 64); |
180 } else { | 184 } else { |
181 style->thumbThickness = 3; | 185 style->thumbThickness = 3; |
182 style->scrollbarMargin = 3; | 186 style->scrollbarMargin = 3; |
183 style->color = SkColorSetARGB(128, 128, 128, 128); | 187 style->color = SkColorSetARGB(128, 128, 128, 128); |
184 } | 188 } |
185 } | 189 } |
186 | 190 |
187 void WebThemeEngineImpl::paint( | 191 void WebThemeEngineImpl::paint( |
188 blink::WebCanvas* canvas, | 192 blink::WebCanvas* canvas, |
189 WebThemeEngine::Part part, | 193 WebThemeEngine::Part part, |
190 WebThemeEngine::State state, | 194 WebThemeEngine::State state, |
191 const blink::WebRect& rect, | 195 const blink::WebRect& rect, |
192 const WebThemeEngine::ExtraParams* extra_params) { | 196 const WebThemeEngine::ExtraParams* extra_params) { |
193 ui::NativeTheme::ExtraParams native_theme_extra_params; | 197 ui::NativeTheme::ExtraParams native_theme_extra_params; |
194 GetNativeThemeExtraParams( | 198 GetNativeThemeExtraParams( |
195 part, state, extra_params, &native_theme_extra_params); | 199 part, state, extra_params, &native_theme_extra_params); |
196 ui::NativeTheme::GetInstanceForWeb()->Paint( | 200 ui::NativeTheme::GetInstanceForWeb()->Paint( |
197 canvas, NativeThemePart(part), NativeThemeState(state), gfx::Rect(rect), | 201 canvas, NativeThemePart(part), NativeThemeState(state), gfx::Rect(rect), |
198 native_theme_extra_params); | 202 native_theme_extra_params); |
199 } | 203 } |
200 } // namespace content | 204 } // namespace content |
OLD | NEW |