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