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 // Enable/disable the experimental app list. If enabled, implies
34 // --enable-centered-app-list.
35 const char kEnableExperimentalAppList
[] = "enable-experimental-app-list";
36 const char kDisableExperimentalAppList
[] = "disable-experimental-app-list";
38 // Enables syncing of the app list independent of extensions.
39 const char kEnableSyncAppList
[] = "enable-sync-app-list";
41 bool IsAppListSyncEnabled() {
42 #if defined(TOOLKIT_VIEWS)
43 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableSyncAppList
);
45 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList
);
49 bool IsFolderUIEnabled() {
50 #if !defined(TOOLKIT_VIEWS)
51 return false; // Folder UI not implemented for Cocoa.
53 // Folder UI is available only when AppList sync is enabled, and should
54 // not be disabled separately.
55 return IsAppListSyncEnabled();
58 bool IsVoiceSearchEnabled() {
59 // Speech recognition in AppList is only for ChromeOS right now.
60 #if defined(OS_CHROMEOS)
67 bool IsAppInfoEnabled() {
68 #if defined(TOOLKIT_VIEWS)
69 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo
);
75 bool IsExperimentalAppListEnabled() {
76 if (CommandLine::ForCurrentProcess()->HasSwitch(kEnableExperimentalAppList
))
79 if (CommandLine::ForCurrentProcess()->HasSwitch(kDisableExperimentalAppList
))
82 #if defined(OS_CHROMEOS)
89 bool IsCenteredAppListEnabled() {
90 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableCenteredAppList
) ||
91 IsExperimentalAppListEnabled();
94 bool ShouldNotDismissOnBlur() {
95 return CommandLine::ForCurrentProcess()->HasSwitch(
96 kDisableAppListDismissOnBlur
);
99 bool IsDriveAppsInAppListEnabled() {
100 #if defined(OS_CHROMEOS)
101 return !CommandLine::ForCurrentProcess()->HasSwitch(
102 kDisableDriveAppsInAppList
);
108 } // namespace switches
109 } // namespace app_list