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 info context menu item is not available in the app list UI.
17 const char kDisableAppInfo
[] = "disable-app-list-app-info";
19 // If set, the app list will not be dismissed when it loses focus. This is
20 // useful when testing the app list or a custom launcher page. It can still be
21 // dismissed via the other methods (like the Esc key).
22 const char kDisableAppListDismissOnBlur
[] = "disable-app-list-dismiss-on-blur";
24 // If set, Drive apps will not be shown side-by-side with Chrome apps.
25 const char kDisableDriveAppsInAppList
[] = "disable-drive-apps-in-app-list";
27 // Disables syncing of the app list independent of extensions.
28 const char kDisableSyncAppList
[] = "disable-sync-app-list";
30 // If set, the app list will be centered and wide instead of tall.
31 const char kEnableCenteredAppList
[] = "enable-centered-app-list";
33 // If set, the experimental app list will be used. Implies
34 // --enable-centered-app-list.
35 const char kEnableExperimentalAppList
[] = "enable-experimental-app-list";
37 // Enables syncing of the app list independent of extensions.
38 const char kEnableSyncAppList
[] = "enable-sync-app-list";
40 bool IsAppListSyncEnabled() {
41 #if defined(TOOLKIT_VIEWS)
42 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableSyncAppList
);
44 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList
);
48 bool IsFolderUIEnabled() {
49 #if !defined(TOOLKIT_VIEWS)
50 return false; // Folder UI not implemented for Cocoa.
52 // Folder UI is available only when AppList sync is enabled, and should
53 // not be disabled separately.
54 return IsAppListSyncEnabled();
57 bool IsVoiceSearchEnabled() {
58 // Speech recognition in AppList is only for ChromeOS right now.
59 #if defined(OS_CHROMEOS)
66 bool IsAppInfoEnabled() {
67 #if defined(TOOLKIT_VIEWS)
68 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo
);
74 bool IsExperimentalAppListEnabled() {
75 return CommandLine::ForCurrentProcess()->HasSwitch(
76 kEnableExperimentalAppList
);
79 bool IsCenteredAppListEnabled() {
80 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableCenteredAppList
) ||
81 IsExperimentalAppListEnabled();
84 bool ShouldNotDismissOnBlur() {
85 return CommandLine::ForCurrentProcess()->HasSwitch(
86 kDisableAppListDismissOnBlur
);
89 bool IsDriveAppsInAppListEnabled() {
90 #if defined(OS_CHROMEOS)
91 return !CommandLine::ForCurrentProcess()->HasSwitch(
92 kDisableDriveAppsInAppList
);
98 } // namespace switches
99 } // namespace app_list