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, the app list will be enabled as if enabled from CWS.
22 const char kEnableAppList
[] = "enable-app-list";
24 // If set, the app list will be centered and wide instead of tall.
25 const char kEnableCenteredAppList
[] = "enable-centered-app-list";
27 // Enable/disable the experimental app list. If enabled, implies
28 // --enable-centered-app-list.
29 const char kEnableExperimentalAppList
[] = "enable-experimental-app-list";
30 const char kDisableExperimentalAppList
[] = "disable-experimental-app-list";
32 // Enable/disable syncing of the app list independent of extensions.
33 const char kEnableSyncAppList
[] = "enable-sync-app-list";
34 const char kDisableSyncAppList
[] = "disable-sync-app-list";
36 // Enable/disable drive search in chrome launcher.
37 const char kEnableDriveSearchInChromeLauncher
[] =
38 "enable-drive-search-in-app-launcher";
39 const char kDisableDriveSearchInChromeLauncher
[] =
40 "disable-drive-search-in-app-launcher";
42 // Enable/disable the new "blended" algorithm in app_list::Mixer. This is just
43 // forcing the AppListMixer/Blended field trial.
44 const char kEnableNewAppListMixer
[] = "enable-new-app-list-mixer";
45 const char kDisableNewAppListMixer
[] = "disable-new-app-list-mixer";
47 // If set, the app list will forget it has been installed on startup. Note this
48 // doesn't prevent the app list from running, it just makes Chrome think the app
49 // list hasn't been enabled (as in kEnableAppList) yet.
50 const char kResetAppListInstallState
[] = "reset-app-list-install-state";
52 #if defined(OS_MACOSX)
53 // Enables use of the toolkit-views app list on Mac.
54 const char kEnableMacViewsAppList
[] = "enable-mac-views-app-list";
57 bool IsAppListSyncEnabled() {
58 #if defined(OS_MACOSX)
59 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList
))
62 if (!IsMacViewsAppListEnabled())
65 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
69 bool IsFolderUIEnabled() {
70 // Folder UI is available only when AppList sync is enabled, and should
71 // not be disabled separately.
72 return IsAppListSyncEnabled();
75 bool IsVoiceSearchEnabled() {
76 // Speech recognition in AppList is only for ChromeOS right now.
77 #if defined(OS_CHROMEOS)
84 bool IsExperimentalAppListEnabled() {
85 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
86 kEnableExperimentalAppList
))
89 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
90 kDisableExperimentalAppList
))
93 #if defined(OS_CHROMEOS)
100 bool IsCenteredAppListEnabled() {
101 return base::CommandLine::ForCurrentProcess()->HasSwitch(
102 kEnableCenteredAppList
) ||
103 IsExperimentalAppListEnabled();
106 bool ShouldNotDismissOnBlur() {
107 return base::CommandLine::ForCurrentProcess()->HasSwitch(
108 kDisableAppListDismissOnBlur
);
111 bool IsDriveAppsInAppListEnabled() {
112 #if defined(OS_CHROMEOS)
119 bool IsDriveSearchInChromeLauncherEnabled() {
120 #if defined(OS_CHROMEOS)
121 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
122 kEnableDriveSearchInChromeLauncher
))
125 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
126 kDisableDriveSearchInChromeLauncher
))
135 #if defined(OS_MACOSX)
136 bool IsMacViewsAppListEnabled() {
137 #if defined(TOOLKIT_VIEWS)
138 return base::CommandLine::ForCurrentProcess()->HasSwitch(
139 kEnableMacViewsAppList
);
143 #endif // defined(OS_MACOSX)
145 } // namespace switches
146 } // namespace app_list