Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / app_list / app_list_switches.cc
blob794051d4b4a914c3158cb8abee7868debe219755
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/app_list/app_list_switches.h"
7 #include "base/command_line.h"
9 namespace app_list {
10 namespace switches {
12 // Specifies the chrome-extension:// URL for the contents of an additional page
13 // added to the experimental app launcher.
14 const char kCustomLauncherPage[] = "custom-launcher-page";
16 // If set, the app list will not be dismissed when it loses focus. This is
17 // useful when testing the app list or a custom launcher page. It can still be
18 // dismissed via the other methods (like the Esc key).
19 const char kDisableAppListDismissOnBlur[] = "disable-app-list-dismiss-on-blur";
21 // If set, Drive apps will not be shown side-by-side with Chrome apps.
22 const char kDisableDriveAppsInAppList[] = "disable-drive-apps-in-app-list";
24 // Disables syncing of the app list independent of extensions.
25 const char kDisableSyncAppList[] = "disable-sync-app-list";
27 // If set, the app list will be centered and wide instead of tall.
28 const char kEnableCenteredAppList[] = "enable-centered-app-list";
30 // Enable/disable the experimental app list. If enabled, implies
31 // --enable-centered-app-list.
32 const char kEnableExperimentalAppList[] = "enable-experimental-app-list";
33 const char kDisableExperimentalAppList[] = "disable-experimental-app-list";
35 // Enables syncing of the app list independent of extensions.
36 const char kEnableSyncAppList[] = "enable-sync-app-list";
38 // Enables launcher search provider api.
39 const char kEnableLauncherSearchProviderApi[] =
40 "enable-launcher-search-provider-api";
42 #if defined(OS_MACOSX)
43 // Enables use of the toolkit-views app list on Mac.
44 const char kEnableMacViewsAppList[] = "enable-mac-views-app-list";
45 #endif
47 bool IsAppListSyncEnabled() {
48 #if defined(OS_MACOSX)
49 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList))
50 return true;
52 if (!IsMacViewsAppListListEnabled())
53 return false;
54 #endif
55 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
56 kDisableSyncAppList);
59 bool IsFolderUIEnabled() {
60 // Folder UI is available only when AppList sync is enabled, and should
61 // not be disabled separately.
62 return IsAppListSyncEnabled();
65 bool IsVoiceSearchEnabled() {
66 // Speech recognition in AppList is only for ChromeOS right now.
67 #if defined(OS_CHROMEOS)
68 return true;
69 #else
70 return false;
71 #endif
74 bool IsExperimentalAppListEnabled() {
75 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
76 kEnableExperimentalAppList))
77 return true;
79 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
80 kDisableExperimentalAppList))
81 return false;
83 #if defined(OS_CHROMEOS)
84 return true;
85 #else
86 return false;
87 #endif
90 bool IsCenteredAppListEnabled() {
91 return base::CommandLine::ForCurrentProcess()->HasSwitch(
92 kEnableCenteredAppList) ||
93 IsExperimentalAppListEnabled();
96 bool ShouldNotDismissOnBlur() {
97 return base::CommandLine::ForCurrentProcess()->HasSwitch(
98 kDisableAppListDismissOnBlur);
101 bool IsDriveAppsInAppListEnabled() {
102 #if defined(OS_CHROMEOS)
103 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
104 kDisableDriveAppsInAppList);
105 #else
106 return false;
107 #endif
110 bool IsLauncherSearchProviderApiEnabled() {
111 #if defined(OS_CHROMEOS)
112 return base::CommandLine::ForCurrentProcess()->HasSwitch(
113 kEnableLauncherSearchProviderApi);
114 #else
115 return false;
116 #endif
119 #if defined(OS_MACOSX)
120 bool IsMacViewsAppListListEnabled() {
121 #if defined(TOOLKIT_VIEWS)
122 return base::CommandLine::ForCurrentProcess()->HasSwitch(
123 kEnableMacViewsAppList);
124 #endif
125 return false;
127 #endif // defined(OS_MACOSX)
129 } // namespace switches
130 } // namespace app_list