platformKeys: Add per-extension sign permissions.
[chromium-blink-merge.git] / ui / app_list / app_list_switches.cc
bloba80013f206d10068293d231e25e08d188f616c57
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 IsAppInfoEnabled() {
71 #if defined(OS_MACOSX)
72 return IsMacViewsAppListListEnabled();
73 #endif
74 return true;
77 bool IsExperimentalAppListEnabled() {
78 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
79 kEnableExperimentalAppList))
80 return true;
82 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
83 kDisableExperimentalAppList))
84 return false;
86 #if defined(OS_CHROMEOS)
87 return true;
88 #else
89 return false;
90 #endif
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);
108 #else
109 return false;
110 #endif
113 #if defined(OS_MACOSX)
114 bool IsMacViewsAppListListEnabled() {
115 #if defined(TOOLKIT_VIEWS)
116 return base::CommandLine::ForCurrentProcess()->HasSwitch(
117 kEnableMacViewsAppList);
118 #endif
119 return false;
121 #endif // defined(OS_MACOSX)
123 } // namespace switches
124 } // namespace app_list