| 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 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 namespace app_list { | 10 namespace app_list { |
| 11 namespace switches { | 11 namespace switches { |
| 12 | 12 |
| 13 // Specifies the chrome-extension:// URL for the contents of an additional page | 13 // Specifies the chrome-extension:// URL for the contents of an additional page |
| 14 // added to the experimental app launcher. | 14 // added to the experimental app launcher. |
| 15 const char kCustomLauncherPage[] = "custom-launcher-page"; | 15 const char kCustomLauncherPage[] = "custom-launcher-page"; |
| 16 | 16 |
| 17 // If set, the app list will not be dismissed when it loses focus. This is | 17 // If set, the app list will not be dismissed when it loses focus. This is |
| 18 // useful when testing the app list or a custom launcher page. It can still be | 18 // useful when testing the app list or a custom launcher page. It can still be |
| 19 // dismissed via the other methods (like the Esc key). | 19 // dismissed via the other methods (like the Esc key). |
| 20 const char kDisableAppListDismissOnBlur[] = "disable-app-list-dismiss-on-blur"; | 20 const char kDisableAppListDismissOnBlur[] = "disable-app-list-dismiss-on-blur"; |
| 21 | 21 |
| 22 // If set, the app list will be enabled as if enabled from CWS. | 22 // If set, the app list will be enabled as if enabled from CWS. |
| 23 const char kEnableAppList[] = "enable-app-list"; | 23 const char kEnableAppList[] = "enable-app-list"; |
| 24 | 24 |
| 25 // If set, the app list will be centered and wide instead of tall. | |
| 26 const char kEnableCenteredAppList[] = "enable-centered-app-list"; | |
| 27 | |
| 28 // Enable/disable the experimental app list. If enabled, implies | |
| 29 // --enable-centered-app-list. | |
| 30 const char kEnableExperimentalAppList[] = "enable-experimental-app-list"; | |
| 31 const char kDisableExperimentalAppList[] = "disable-experimental-app-list"; | |
| 32 | |
| 33 // Enable/disable syncing of the app list independent of extensions. | 25 // Enable/disable syncing of the app list independent of extensions. |
| 34 const char kEnableSyncAppList[] = "enable-sync-app-list"; | 26 const char kEnableSyncAppList[] = "enable-sync-app-list"; |
| 35 const char kDisableSyncAppList[] = "disable-sync-app-list"; | 27 const char kDisableSyncAppList[] = "disable-sync-app-list"; |
| 36 | 28 |
| 37 // Enable/disable drive search in chrome launcher. | 29 // Enable/disable drive search in chrome launcher. |
| 38 const char kEnableDriveSearchInChromeLauncher[] = | 30 const char kEnableDriveSearchInChromeLauncher[] = |
| 39 "enable-drive-search-in-app-launcher"; | 31 "enable-drive-search-in-app-launcher"; |
| 40 const char kDisableDriveSearchInChromeLauncher[] = | 32 const char kDisableDriveSearchInChromeLauncher[] = |
| 41 "disable-drive-search-in-app-launcher"; | 33 "disable-drive-search-in-app-launcher"; |
| 42 | 34 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 bool IsVoiceSearchEnabled() { | 54 bool IsVoiceSearchEnabled() { |
| 63 // Speech recognition in AppList is only for ChromeOS right now. | 55 // Speech recognition in AppList is only for ChromeOS right now. |
| 64 #if defined(OS_CHROMEOS) | 56 #if defined(OS_CHROMEOS) |
| 65 return true; | 57 return true; |
| 66 #else | 58 #else |
| 67 return false; | 59 return false; |
| 68 #endif | 60 #endif |
| 69 } | 61 } |
| 70 | 62 |
| 71 bool IsExperimentalAppListEnabled() { | 63 bool IsExperimentalAppListEnabled() { |
| 72 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 64 // TODO(mgiuca): Remove this function. (https://crbug.com/531059) |
| 73 kEnableExperimentalAppList)) | |
| 74 return true; | |
| 75 | |
| 76 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 77 kDisableExperimentalAppList)) | |
| 78 return false; | |
| 79 | |
| 80 #if defined(OS_CHROMEOS) | |
| 81 return true; | 65 return true; |
| 82 #else | |
| 83 return false; | |
| 84 #endif | |
| 85 } | 66 } |
| 86 | 67 |
| 87 bool IsCenteredAppListEnabled() { | 68 bool IsCenteredAppListEnabled() { |
| 88 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 69 // TODO(mgiuca): Remove this function. (https://crbug.com/531059) |
| 89 kEnableCenteredAppList) || | 70 return true; |
| 90 IsExperimentalAppListEnabled(); | |
| 91 } | 71 } |
| 92 | 72 |
| 93 bool ShouldNotDismissOnBlur() { | 73 bool ShouldNotDismissOnBlur() { |
| 94 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 74 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 95 kDisableAppListDismissOnBlur); | 75 kDisableAppListDismissOnBlur); |
| 96 } | 76 } |
| 97 | 77 |
| 98 bool IsDriveAppsInAppListEnabled() { | 78 bool IsDriveAppsInAppListEnabled() { |
| 99 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
| 100 return true; | 80 return true; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 114 return false; | 94 return false; |
| 115 | 95 |
| 116 return true; | 96 return true; |
| 117 #else | 97 #else |
| 118 return false; | 98 return false; |
| 119 #endif | 99 #endif |
| 120 } | 100 } |
| 121 | 101 |
| 122 } // namespace switches | 102 } // namespace switches |
| 123 } // namespace app_list | 103 } // namespace app_list |
| OLD | NEW |