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

Unified Diff: ui/native_theme/native_theme_switches.cc

Issue 2175163005: Add flag to hide scrollbars completely. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ShouldHideScrollbars(). 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
« no previous file with comments | « ui/native_theme/native_theme_switches.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_switches.cc
diff --git a/ui/native_theme/native_theme_switches.cc b/ui/native_theme/native_theme_switches.cc
index 873af518985c1dc6226256118424e2a6493dd086..fc8c0ff40285a2a6de36ce94df2f3e466b12bd40 100644
--- a/ui/native_theme/native_theme_switches.cc
+++ b/ui/native_theme/native_theme_switches.cc
@@ -13,6 +13,9 @@ const char kEnableOverlayScrollbar[] = "enable-overlay-scrollbar";
// Disables overlay scrollbars on Aura or Linux. Does nothing on Mac.
const char kDisableOverlayScrollbar[] = "disable-overlay-scrollbar";
+// Hides scrollbars on Aura, Linux, Android, ChromeOS. Does nothing on Mac.
+const char kHideScrollbars[] = "hide-scrollbars";
+
} // namespace switches
namespace ui {
@@ -21,6 +24,10 @@ bool IsOverlayScrollbarEnabled() {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
+ // Hidden scrollbars are realized through never-showing overlay scrollbars.
+ if (ShouldHideScrollbars())
+ return true;
+
if (command_line.HasSwitch(switches::kDisableOverlayScrollbar))
return false;
else if (command_line.HasSwitch(switches::kEnableOverlayScrollbar))
@@ -29,4 +36,10 @@ bool IsOverlayScrollbarEnabled() {
return false;
}
+bool ShouldHideScrollbars() {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ return command_line.HasSwitch(switches::kHideScrollbars);
+}
+
} // namespace ui
« no previous file with comments | « ui/native_theme/native_theme_switches.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698