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 // Disables syncing of the app list independent of extensions.
13 const char kDisableSyncAppList[] = "disable-sync-app-list";
15 // If set, the voice search is disabled in app list UI.
16 const char kEnableVoiceSearch[] = "enable-app-list-voice-search";
18 // If set, the app info context menu item is available in the app list UI.
19 const char kEnableAppInfo[] = "enable-app-list-app-info";
21 // If set, the experimental app list will be used.
22 const char kEnableExperimentalAppList[] = "enable-experimental-app-list";
24 // If set, the experimental app list position will be used.
25 const char kEnableExperimentalAppListPosition[] =
26 "enable-experimental-app-list-position";
28 // If set, it will always listen to the audio locally and open the app-list
29 // when the hotword is recognized.
30 const char kEnableHotwordAlwaysOn[] = "enable-app-list-hotword-always-on";
32 // Enables syncing of the app list independent of extensions.
33 const char kEnableSyncAppList[] = "enable-sync-app-list";
35 bool IsAppListSyncEnabled() {
36 #if defined(OS_CHROMEOS)
37 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableSyncAppList);
39 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList);
43 bool IsFolderUIEnabled() {
44 #if defined(OS_MACOSX)
45 return false; // Folder UI not implemented for OSX
47 // Folder UI is available only when AppList sync is enabled, and should
48 // not be disabled separately.
49 return IsAppListSyncEnabled();
52 bool IsVoiceSearchEnabled() {
53 // Speech recognition in AppList is only for ChromeOS right now.
54 #if defined(OS_CHROMEOS)
55 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableVoiceSearch);
61 bool IsHotwordAlwaysOnEnabled() {
62 #if defined(OS_CHROMEOS)
63 return IsVoiceSearchEnabled() &&
64 CommandLine::ForCurrentProcess()->HasSwitch(kEnableHotwordAlwaysOn);
70 bool IsAppInfoEnabled() {
71 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableAppInfo);
74 bool IsExperimentalAppListEnabled() {
75 return CommandLine::ForCurrentProcess()->HasSwitch(
76 kEnableExperimentalAppList);
79 bool IsExperimentalAppListPositionEnabled() {
80 return CommandLine::ForCurrentProcess()->HasSwitch(
81 kEnableExperimentalAppListPosition) ||
82 IsExperimentalAppListEnabled();
85 } // namespace switches
86 } // namespace app_list