Implement MoveFileLocal (with creating a snapshot).
[chromium-blink-merge.git] / ui / app_list / app_list_switches.cc
blobc528c7162d4697be8333d5ceb7cf015de3bcdee3
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"
9 namespace app_list {
10 namespace switches {
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";
41 #endif
43 bool IsAppListSyncEnabled() {
44 #if defined(OS_MACOSX)
45 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList))
46 return true;
48 if (!IsMacViewsAppListListEnabled())
49 return false;
50 #endif
51 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
52 kDisableSyncAppList);
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)
64 return true;
65 #else
66 return false;
67 #endif
70 bool IsExperimentalAppListEnabled() {
71 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
72 kEnableExperimentalAppList))
73 return true;
75 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
76 kDisableExperimentalAppList))
77 return false;
79 #if defined(OS_CHROMEOS)
80 return true;
81 #else
82 return false;
83 #endif
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);
101 #else
102 return false;
103 #endif
106 #if defined(OS_MACOSX)
107 bool IsMacViewsAppListListEnabled() {
108 #if defined(TOOLKIT_VIEWS)
109 return base::CommandLine::ForCurrentProcess()->HasSwitch(
110 kEnableMacViewsAppList);
111 #endif
112 return false;
114 #endif // defined(OS_MACOSX)
116 } // namespace switches
117 } // namespace app_list