OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/app_list/app_list_switches.h" | 5 #include "ui/app_list/app_list_switches.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 | 8 |
9 namespace app_list { | 9 namespace app_list { |
10 namespace switches { | 10 namespace switches { |
11 | 11 |
12 // If set, the app info context menu item is not available in the app list UI. | 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"; | 13 const char kDisableAppInfo[] = "disable-app-list-app-info"; |
14 | 14 |
15 // Disables syncing of the app list independent of extensions. | 15 // Disables syncing of the app list independent of extensions. |
16 const char kDisableSyncAppList[] = "disable-sync-app-list"; | 16 const char kDisableSyncAppList[] = "disable-sync-app-list"; |
17 | 17 |
| 18 // If set, the voice search is disabled in app list UI. |
| 19 const char kDisableVoiceSearch[] = "disable-app-list-voice-search"; |
| 20 |
18 // If set, the app list will be centered and wide instead of tall. | 21 // If set, the app list will be centered and wide instead of tall. |
19 const char kEnableCenteredAppList[] = "enable-centered-app-list"; | 22 const char kEnableCenteredAppList[] = "enable-centered-app-list"; |
20 | 23 |
21 // If set, Drive apps of the user shows side-by-side with Chrome apps. | 24 // If set, Drive apps of the user shows side-by-side with Chrome apps. |
22 const char kEnableDriveAppsInAppList[] = "enable-drive-apps-in-app-list"; | 25 const char kEnableDriveAppsInAppList[] = "enable-drive-apps-in-app-list"; |
23 | 26 |
24 // If set, the experimental app list will be used. Implies | 27 // If set, the experimental app list will be used. Implies |
25 // --enable-centered-app-list. | 28 // --enable-centered-app-list. |
26 const char kEnableExperimentalAppList[] = "enable-experimental-app-list"; | 29 const char kEnableExperimentalAppList[] = "enable-experimental-app-list"; |
27 | 30 |
(...skipping 13 matching lines...) Expand all Loading... |
41 return false; // Folder UI not implemented for Cocoa. | 44 return false; // Folder UI not implemented for Cocoa. |
42 #endif | 45 #endif |
43 // Folder UI is available only when AppList sync is enabled, and should | 46 // Folder UI is available only when AppList sync is enabled, and should |
44 // not be disabled separately. | 47 // not be disabled separately. |
45 return IsAppListSyncEnabled(); | 48 return IsAppListSyncEnabled(); |
46 } | 49 } |
47 | 50 |
48 bool IsVoiceSearchEnabled() { | 51 bool IsVoiceSearchEnabled() { |
49 // Speech recognition in AppList is only for ChromeOS right now. | 52 // Speech recognition in AppList is only for ChromeOS right now. |
50 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
51 return true; | 54 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableVoiceSearch); |
52 #else | 55 #else |
53 return false; | 56 return false; |
54 #endif | 57 #endif |
55 } | 58 } |
56 | 59 |
57 bool IsAppInfoEnabled() { | 60 bool IsAppInfoEnabled() { |
58 #if defined(TOOLKIT_VIEWS) | 61 #if defined(TOOLKIT_VIEWS) |
59 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo); | 62 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo); |
60 #else | 63 #else |
61 return false; | 64 return false; |
62 #endif | 65 #endif |
63 } | 66 } |
64 | 67 |
65 bool IsExperimentalAppListEnabled() { | 68 bool IsExperimentalAppListEnabled() { |
66 return CommandLine::ForCurrentProcess()->HasSwitch( | 69 return CommandLine::ForCurrentProcess()->HasSwitch( |
67 kEnableExperimentalAppList); | 70 kEnableExperimentalAppList); |
68 } | 71 } |
69 | 72 |
70 bool IsCenteredAppListEnabled() { | 73 bool IsCenteredAppListEnabled() { |
71 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableCenteredAppList) || | 74 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableCenteredAppList) || |
72 IsExperimentalAppListEnabled(); | 75 IsExperimentalAppListEnabled(); |
73 } | 76 } |
74 | 77 |
75 bool IsDriveAppsInAppListEnabled() { | 78 bool IsDriveAppsInAppListEnabled() { |
76 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableDriveAppsInAppList); | 79 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableDriveAppsInAppList); |
77 } | 80 } |
78 | 81 |
79 } // namespace switches | 82 } // namespace switches |
80 } // namespace app_list | 83 } // namespace app_list |
OLD | NEW |