Chromium Code Reviews| 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..a40821124488e558cc6db910f6d1c31cb6dd62d3 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. |
|
skobes
2016/08/02 17:55:56
What's the plan for Mac? Or don't we care?
Eric Seckler
2016/08/03 17:34:54
At the moment, we don't care and will look into th
|
| +const char kEnableHiddenScrollbar[] = "enable-hidden-scrollbar"; |
|
skobes
2016/08/02 17:55:56
Will there also be a disable flag? If not, perhap
Eric Seckler
2016/08/03 17:34:54
Done. I was aiming for consistent naming, but you'
|
| + |
| } // 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 (IsHiddenScrollbarEnabled()) |
| + return true; |
| + |
| if (command_line.HasSwitch(switches::kDisableOverlayScrollbar)) |
| return false; |
| else if (command_line.HasSwitch(switches::kEnableOverlayScrollbar)) |
| @@ -29,4 +36,14 @@ bool IsOverlayScrollbarEnabled() { |
| return false; |
| } |
| +bool IsHiddenScrollbarEnabled() { |
|
skobes
2016/08/02 17:55:56
"ShouldHideScrollbars"
Eric Seckler
2016/08/03 17:34:54
Done.
|
| + const base::CommandLine& command_line = |
| + *base::CommandLine::ForCurrentProcess(); |
| + |
| + if (command_line.HasSwitch(switches::kEnableHiddenScrollbar)) |
| + return true; |
| + |
| + return false; |
| +} |
| + |
| } // namespace ui |