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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp

Issue 2239313002: Hide non-composited native scrollbars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use hidden overlay theme on all platforms. Created 4 years, 4 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
Index: third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp
index aac9bb4255313c6870002f840f5ac9720a846230..9b7e2930a8401e157619fd97ac55e66e14ed3b59 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp
@@ -296,6 +296,10 @@ void ScrollbarTheme::splitTrack(const ScrollbarThemeClient& scrollbar, const Int
ScrollbarTheme& ScrollbarTheme::theme()
{
if (ScrollbarTheme::mockScrollbarsEnabled()) {
+ if (RuntimeEnabledFeatures::hideScrollbarsEnabled()) {
+ DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, hiddenMockTheme, (ScrollbarThemeOverlayMock::HideScrollbars));
+ return hiddenMockTheme;
+ }
if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) {
DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, overlayMockTheme, ());
return overlayMockTheme;
@@ -304,6 +308,10 @@ ScrollbarTheme& ScrollbarTheme::theme()
DEFINE_STATIC_LOCAL(ScrollbarThemeMock, mockTheme, ());
return mockTheme;
}
+ if (RuntimeEnabledFeatures::overlayScrollbarsEnabled() && RuntimeEnabledFeatures::hideScrollbarsEnabled()) {
skobes 2016/08/12 18:29:54 Do we need to check overlayScrollbarsEnabled(), or
+ DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, hiddenTheme, (0, 0, ScrollbarThemeOverlay::DisallowHitTest, Color()));
+ return hiddenTheme;
+ }
return nativeTheme();
}

Powered by Google App Engine
This is Rietveld 408576698