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 IsAppInfoEnabled() {
71 #if defined(OS_MACOSX)
72 return IsMacViewsAppListListEnabled();
77 bool IsExperimentalAppListEnabled() {
78 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
79 kEnableExperimentalAppList
))
82 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
83 kDisableExperimentalAppList
))
86 #if defined(OS_CHROMEOS)
93 bool IsCenteredAppListEnabled() {
94 return base::CommandLine::ForCurrentProcess()->HasSwitch(
95 kEnableCenteredAppList
) ||
96 IsExperimentalAppListEnabled();
99 bool ShouldNotDismissOnBlur() {
100 return base::CommandLine::ForCurrentProcess()->HasSwitch(
101 kDisableAppListDismissOnBlur
);
104 bool IsDriveAppsInAppListEnabled() {
105 #if defined(OS_CHROMEOS)
106 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
107 kDisableDriveAppsInAppList
);
113 #if defined(OS_MACOSX)
114 bool IsMacViewsAppListListEnabled() {
115 #if defined(TOOLKIT_VIEWS)
116 return base::CommandLine::ForCurrentProcess()->HasSwitch(
117 kEnableMacViewsAppList
);
121 #endif // defined(OS_MACOSX)
123 } // namespace switches
124 } // namespace app_list