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

Unified Diff: content/child/webthemeengine_impl_android.cc

Issue 2734483002: Reland Change minimum length of Aura overlay scrollbars. (Closed)
Patch Set: Fix breakage on Android Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webthemeengine_impl_android.cc
diff --git a/content/child/webthemeengine_impl_android.cc b/content/child/webthemeengine_impl_android.cc
index fa693b3cf9cb828de50d999ba530dc43c3a85629..d659241610153438bf17cbc3dbe73d0a3699d3de 100644
--- a/content/child/webthemeengine_impl_android.cc
+++ b/content/child/webthemeengine_impl_android.cc
@@ -39,13 +39,15 @@ static ui::NativeTheme::Part NativeThemePart(WebThemeEngine::Part part) {
case WebThemeEngine::PartScrollbarUpArrow:
return ui::NativeTheme::kScrollbarUpArrow;
case WebThemeEngine::PartScrollbarHorizontalThumb:
+ return ui::NativeTheme::kScrollbarHorizontalThumb;
case WebThemeEngine::PartScrollbarVerticalThumb:
+ return ui::NativeTheme::kScrollbarVerticalThumb;
case WebThemeEngine::PartScrollbarHorizontalTrack:
+ return ui::NativeTheme::kScrollbarHorizontalTrack;
case WebThemeEngine::PartScrollbarVerticalTrack:
+ return ui::NativeTheme::kScrollbarVerticalTrack;
case WebThemeEngine::PartScrollbarCorner:
- // Android doesn't draw scrollbars.
- NOTREACHED();
- return static_cast<ui::NativeTheme::Part>(0);
+ return ui::NativeTheme::kScrollbarCorner;
case WebThemeEngine::PartCheckbox:
return ui::NativeTheme::kCheckbox;
case WebThemeEngine::PartRadio:
@@ -167,9 +169,21 @@ static void GetNativeThemeExtraParams(
}
blink::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) {
- ui::NativeTheme::ExtraParams extra;
- return ui::NativeTheme::GetInstanceForWeb()->GetPartSize(
- NativeThemePart(part), ui::NativeTheme::kNormal, extra);
+ switch (part) {
+ case ui::NativeTheme::kScrollbarHorizontalThumb:
+ case ui::NativeTheme::kScrollbarVerticalThumb: {
+ // Minimum length for scrollbar thumb is the scrollbar thickness.
+ ScrollbarStyle style;
+ getOverlayScrollbarStyle(&style);
+ int scrollbarThickness = style.thumbThickness + style.scrollbarMargin;
+ return gfx::Size(scrollbarThickness, scrollbarThickness);
+ }
+ default: {
+ ui::NativeTheme::ExtraParams extra;
+ return ui::NativeTheme::GetInstanceForWeb()->GetPartSize(
+ NativeThemePart(part), ui::NativeTheme::kNormal, extra);
+ }
+ }
}
void WebThemeEngineImpl::getOverlayScrollbarStyle(ScrollbarStyle* style) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698