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

Side by Side Diff: ui/native_theme/native_theme_switches.cc

Issue 2239313002: Hide non-composited native scrollbars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment 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
« no previous file with comments | « third_party/WebKit/public/web/WebRuntimeFeatures.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. 16 // Hides scrollbars on Aura, Linux, Android, ChromeOS, MacOS (MacOS
17 // support is experimental).
17 const char kHideScrollbars[] = "hide-scrollbars"; 18 const char kHideScrollbars[] = "hide-scrollbars";
18 19
19 } // namespace switches 20 } // namespace switches
20 21
21 namespace ui { 22 namespace ui {
22 23
23 bool IsOverlayScrollbarEnabled() { 24 bool IsOverlayScrollbarEnabled() {
24 const base::CommandLine& command_line = 25 const base::CommandLine& command_line =
25 *base::CommandLine::ForCurrentProcess(); 26 *base::CommandLine::ForCurrentProcess();
26 27
27 // Hidden scrollbars are realized through never-showing overlay scrollbars. 28 // Hidden scrollbars are realized through never-showing overlay scrollbars.
28 if (ShouldHideScrollbars()) 29 if (ShouldHideScrollbars())
29 return true; 30 return true;
30 31
31 if (command_line.HasSwitch(switches::kDisableOverlayScrollbar)) 32 if (command_line.HasSwitch(switches::kDisableOverlayScrollbar))
32 return false; 33 return false;
33 else if (command_line.HasSwitch(switches::kEnableOverlayScrollbar)) 34 else if (command_line.HasSwitch(switches::kEnableOverlayScrollbar))
34 return true; 35 return true;
35 36
36 return false; 37 return false;
37 } 38 }
38 39
39 bool ShouldHideScrollbars() { 40 bool ShouldHideScrollbars() {
40 const base::CommandLine& command_line = 41 const base::CommandLine& command_line =
41 *base::CommandLine::ForCurrentProcess(); 42 *base::CommandLine::ForCurrentProcess();
42 return command_line.HasSwitch(switches::kHideScrollbars); 43 return command_line.HasSwitch(switches::kHideScrollbars);
43 } 44 }
44 45
45 } // namespace ui 46 } // namespace ui
OLDNEW
« no previous file with comments | « third_party/WebKit/public/web/WebRuntimeFeatures.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698