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"
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";
60 bool IsAppListSyncEnabled() {
61 #if defined(OS_MACOSX)
62 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList
))
65 if (!IsMacViewsAppListEnabled())
68 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
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)
87 bool IsExperimentalAppListEnabled() {
88 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
89 kEnableExperimentalAppList
))
92 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
93 kDisableExperimentalAppList
))
96 #if defined(OS_CHROMEOS)
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
);
123 bool IsDriveSearchInChromeLauncherEnabled() {
124 #if defined(OS_CHROMEOS)
125 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
126 kEnableDriveSearchInChromeLauncher
))
129 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
130 kDisableDriveSearchInChromeLauncher
))
139 #if defined(OS_MACOSX)
140 bool IsMacViewsAppListEnabled() {
141 #if defined(TOOLKIT_VIEWS)
142 return base::CommandLine::ForCurrentProcess()->HasSwitch(
143 kEnableMacViewsAppList
);
147 #endif // defined(OS_MACOSX)
149 } // namespace switches
150 } // namespace app_list