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 // 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";
47 bool IsAppListSyncEnabled() {
48 #if defined(OS_MACOSX)
49 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList
))
52 if (!IsMacViewsAppListListEnabled())
55 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
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)
74 bool IsExperimentalAppListEnabled() {
75 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
76 kEnableExperimentalAppList
))
79 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
80 kDisableExperimentalAppList
))
83 #if defined(OS_CHROMEOS)
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
);
110 bool IsLauncherSearchProviderApiEnabled() {
111 #if defined(OS_CHROMEOS)
112 return base::CommandLine::ForCurrentProcess()->HasSwitch(
113 kEnableLauncherSearchProviderApi
);
119 #if defined(OS_MACOSX)
120 bool IsMacViewsAppListListEnabled() {
121 #if defined(TOOLKIT_VIEWS)
122 return base::CommandLine::ForCurrentProcess()->HasSwitch(
123 kEnableMacViewsAppList
);
127 #endif // defined(OS_MACOSX)
129 } // namespace switches
130 } // namespace app_list