Performance histograms for extension content verification
[chromium-blink-merge.git] / ui / app_list / app_list_switches.cc
blob4e9ebf3059f96d55a969a117aff81925537fb343
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 // If set, the app info context menu item is not available in the app list UI.
13 const char kDisableAppInfo[] = "disable-app-list-app-info";
15 // Disables syncing of the app list independent of extensions.
16 const char kDisableSyncAppList[] = "disable-sync-app-list";
18 // If set, the voice search is disabled in app list UI.
19 const char kDisableVoiceSearch[] = "disable-app-list-voice-search";
21 // If set, the app list will be centered and wide instead of tall.
22 const char kEnableCenteredAppList[] = "enable-centered-app-list";
24 // If set, Drive apps of the user shows side-by-side with Chrome apps.
25 const char kEnableDriveAppsInAppList[] = "enable-drive-apps-in-app-list";
27 // If set, the experimental app list will be used. Implies
28 // --enable-centered-app-list.
29 const char kEnableExperimentalAppList[] = "enable-experimental-app-list";
31 // Enables syncing of the app list independent of extensions.
32 const char kEnableSyncAppList[] = "enable-sync-app-list";
34 bool IsAppListSyncEnabled() {
35 #if defined(TOOLKIT_VIEWS)
36 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableSyncAppList);
37 #else
38 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList);
39 #endif
42 bool IsFolderUIEnabled() {
43 #if !defined(TOOLKIT_VIEWS)
44 return false; // Folder UI not implemented for Cocoa.
45 #endif
46 // Folder UI is available only when AppList sync is enabled, and should
47 // not be disabled separately.
48 return IsAppListSyncEnabled();
51 bool IsVoiceSearchEnabled() {
52 // Speech recognition in AppList is only for ChromeOS right now.
53 #if defined(OS_CHROMEOS)
54 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableVoiceSearch);
55 #else
56 return false;
57 #endif
60 bool IsAppInfoEnabled() {
61 #if defined(TOOLKIT_VIEWS)
62 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo);
63 #else
64 return false;
65 #endif
68 bool IsExperimentalAppListEnabled() {
69 return CommandLine::ForCurrentProcess()->HasSwitch(
70 kEnableExperimentalAppList);
73 bool IsCenteredAppListEnabled() {
74 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableCenteredAppList) ||
75 IsExperimentalAppListEnabled();
78 bool IsDriveAppsInAppListEnabled() {
79 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableDriveAppsInAppList);
82 } // namespace switches
83 } // namespace app_list