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

Side by Side 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: add tests for scrollbar behavior without animator. 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 unified diff | Download patch
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "ui/native_theme/native_theme_switches.h" 6 #include "ui/native_theme/native_theme_switches.h"
7 7
8 namespace switches { 8 namespace switches {
9 9
10 // Enables overlay scrollbars on Aura or Linux. Does nothing on Mac. 10 // Enables overlay scrollbars on Aura or Linux. Does nothing on Mac.
11 const char kEnableOverlayScrollbar[] = "enable-overlay-scrollbar"; 11 const char kEnableOverlayScrollbar[] = "enable-overlay-scrollbar";
12 12
13 // Disables overlay scrollbars on Aura or Linux. Does nothing on Mac. 13 // Disables overlay scrollbars on Aura or Linux. Does nothing on Mac.
14 const char kDisableOverlayScrollbar[] = "disable-overlay-scrollbar"; 14 const char kDisableOverlayScrollbar[] = "disable-overlay-scrollbar";
15 15
16 // 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
17 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'
18
16 } // namespace switches 19 } // namespace switches
17 20
18 namespace ui { 21 namespace ui {
19 22
20 bool IsOverlayScrollbarEnabled() { 23 bool IsOverlayScrollbarEnabled() {
21 const base::CommandLine& command_line = 24 const base::CommandLine& command_line =
22 *base::CommandLine::ForCurrentProcess(); 25 *base::CommandLine::ForCurrentProcess();
23 26
27 // Hidden scrollbars are realized through never-showing overlay scrollbars.
28 if (IsHiddenScrollbarEnabled())
29 return true;
30
24 if (command_line.HasSwitch(switches::kDisableOverlayScrollbar)) 31 if (command_line.HasSwitch(switches::kDisableOverlayScrollbar))
25 return false; 32 return false;
26 else if (command_line.HasSwitch(switches::kEnableOverlayScrollbar)) 33 else if (command_line.HasSwitch(switches::kEnableOverlayScrollbar))
27 return true; 34 return true;
28 35
29 return false; 36 return false;
30 } 37 }
31 38
39 bool IsHiddenScrollbarEnabled() {
skobes 2016/08/02 17:55:56 "ShouldHideScrollbars"
Eric Seckler 2016/08/03 17:34:54 Done.
40 const base::CommandLine& command_line =
41 *base::CommandLine::ForCurrentProcess();
42
43 if (command_line.HasSwitch(switches::kEnableHiddenScrollbar))
44 return true;
45
46 return false;
47 }
48
32 } // namespace ui 49 } // namespace ui
OLDNEW
« ui/native_theme/native_theme_switches.h ('K') | « 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