Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / app_list / app_list_switches.cc
blob2094fde64edf5559eb6e5d35648fa4828f3092b0
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 // If set, the app list will be enabled as if enabled from CWS.
25 const char kEnableAppList[] = "enable-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 // Enable/disable syncing of the app list independent of extensions.
36 const char kEnableSyncAppList[] = "enable-sync-app-list";
37 const char kDisableSyncAppList[] = "disable-sync-app-list";
39 // Enable/disable drive search in chrome launcher.
40 const char kEnableDriveSearchInChromeLauncher[] =
41 "enable-drive-search-in-app-launcher";
42 const char kDisableDriveSearchInChromeLauncher[] =
43 "disable-drive-search-in-app-launcher";
45 // Enable/disable the new "blended" algorithm in app_list::Mixer. This is just
46 // forcing the AppListMixer/Blended field trial.
47 const char kEnableNewAppListMixer[] = "enable-new-app-list-mixer";
48 const char kDisableNewAppListMixer[] = "disable-new-app-list-mixer";
50 // If set, the app list will forget it has been installed on startup. Note this
51 // doesn't prevent the app list from running, it just makes Chrome think the app
52 // list hasn't been enabled (as in kEnableAppList) yet.
53 const char kResetAppListInstallState[] = "reset-app-list-install-state";
55 #if defined(OS_MACOSX)
56 // Enables use of the toolkit-views app list on Mac.
57 const char kEnableMacViewsAppList[] = "enable-mac-views-app-list";
58 #endif
60 bool IsAppListSyncEnabled() {
61 #if defined(OS_MACOSX)
62 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList))
63 return true;
65 if (!IsMacViewsAppListEnabled())
66 return false;
67 #endif
68 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
69 kDisableSyncAppList);
72 bool IsFolderUIEnabled() {
73 // Folder UI is available only when AppList sync is enabled, and should
74 // not be disabled separately.
75 return IsAppListSyncEnabled();
78 bool IsVoiceSearchEnabled() {
79 // Speech recognition in AppList is only for ChromeOS right now.
80 #if defined(OS_CHROMEOS)
81 return true;
82 #else
83 return false;
84 #endif
87 bool IsExperimentalAppListEnabled() {
88 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
89 kEnableExperimentalAppList))
90 return true;
92 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
93 kDisableExperimentalAppList))
94 return false;
96 #if defined(OS_CHROMEOS)
97 return true;
98 #else
99 return false;
100 #endif
103 bool IsCenteredAppListEnabled() {
104 return base::CommandLine::ForCurrentProcess()->HasSwitch(
105 kEnableCenteredAppList) ||
106 IsExperimentalAppListEnabled();
109 bool ShouldNotDismissOnBlur() {
110 return base::CommandLine::ForCurrentProcess()->HasSwitch(
111 kDisableAppListDismissOnBlur);
114 bool IsDriveAppsInAppListEnabled() {
115 #if defined(OS_CHROMEOS)
116 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
117 kDisableDriveAppsInAppList);
118 #else
119 return false;
120 #endif
123 bool IsDriveSearchInChromeLauncherEnabled() {
124 #if defined(OS_CHROMEOS)
125 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
126 kEnableDriveSearchInChromeLauncher))
127 return true;
129 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
130 kDisableDriveSearchInChromeLauncher))
131 return false;
133 return true;
134 #else
135 return false;
136 #endif
139 #if defined(OS_MACOSX)
140 bool IsMacViewsAppListEnabled() {
141 #if defined(TOOLKIT_VIEWS)
142 return base::CommandLine::ForCurrentProcess()->HasSwitch(
143 kEnableMacViewsAppList);
144 #endif
145 return false;
147 #endif // defined(OS_MACOSX)
149 } // namespace switches
150 } // namespace app_list