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 #if defined(OS_MACOSX)
39 // Enables use of the toolkit-views app list on Mac.
40 const char kEnableMacViewsAppList
[] = "enable-mac-views-app-list";
43 bool IsAppListSyncEnabled() {
44 #if defined(OS_MACOSX)
45 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList
))
48 if (!IsMacViewsAppListListEnabled())
51 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
55 bool IsFolderUIEnabled() {
56 // Folder UI is available only when AppList sync is enabled, and should
57 // not be disabled separately.
58 return IsAppListSyncEnabled();
61 bool IsVoiceSearchEnabled() {
62 // Speech recognition in AppList is only for ChromeOS right now.
63 #if defined(OS_CHROMEOS)
70 bool IsExperimentalAppListEnabled() {
71 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
72 kEnableExperimentalAppList
))
75 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
76 kDisableExperimentalAppList
))
79 #if defined(OS_CHROMEOS)
86 bool IsCenteredAppListEnabled() {
87 return base::CommandLine::ForCurrentProcess()->HasSwitch(
88 kEnableCenteredAppList
) ||
89 IsExperimentalAppListEnabled();
92 bool ShouldNotDismissOnBlur() {
93 return base::CommandLine::ForCurrentProcess()->HasSwitch(
94 kDisableAppListDismissOnBlur
);
97 bool IsDriveAppsInAppListEnabled() {
98 #if defined(OS_CHROMEOS)
99 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
100 kDisableDriveAppsInAppList
);
106 #if defined(OS_MACOSX)
107 bool IsMacViewsAppListListEnabled() {
108 #if defined(TOOLKIT_VIEWS)
109 return base::CommandLine::ForCurrentProcess()->HasSwitch(
110 kEnableMacViewsAppList
);
114 #endif // defined(OS_MACOSX)
116 } // namespace switches
117 } // namespace app_list