| 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 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // Enable/disable the experimental app list. If enabled, implies | 33 // Enable/disable the experimental app list. If enabled, implies |
| 34 // --enable-centered-app-list. | 34 // --enable-centered-app-list. |
| 35 const char kEnableExperimentalAppList[] = "enable-experimental-app-list"; | 35 const char kEnableExperimentalAppList[] = "enable-experimental-app-list"; |
| 36 const char kDisableExperimentalAppList[] = "disable-experimental-app-list"; | 36 const char kDisableExperimentalAppList[] = "disable-experimental-app-list"; |
| 37 | 37 |
| 38 // Enables syncing of the app list independent of extensions. | 38 // Enables syncing of the app list independent of extensions. |
| 39 const char kEnableSyncAppList[] = "enable-sync-app-list"; | 39 const char kEnableSyncAppList[] = "enable-sync-app-list"; |
| 40 | 40 |
| 41 bool IsAppListSyncEnabled() { | 41 bool IsAppListSyncEnabled() { |
| 42 #if defined(TOOLKIT_VIEWS) | 42 #if defined(TOOLKIT_VIEWS) |
| 43 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableSyncAppList); | 43 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 44 kDisableSyncAppList); |
| 44 #else | 45 #else |
| 45 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList); | 46 return base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableSyncAppList); |
| 46 #endif | 47 #endif |
| 47 } | 48 } |
| 48 | 49 |
| 49 bool IsFolderUIEnabled() { | 50 bool IsFolderUIEnabled() { |
| 50 #if !defined(TOOLKIT_VIEWS) | 51 #if !defined(TOOLKIT_VIEWS) |
| 51 return false; // Folder UI not implemented for Cocoa. | 52 return false; // Folder UI not implemented for Cocoa. |
| 52 #endif | 53 #endif |
| 53 // Folder UI is available only when AppList sync is enabled, and should | 54 // Folder UI is available only when AppList sync is enabled, and should |
| 54 // not be disabled separately. | 55 // not be disabled separately. |
| 55 return IsAppListSyncEnabled(); | 56 return IsAppListSyncEnabled(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 bool IsVoiceSearchEnabled() { | 59 bool IsVoiceSearchEnabled() { |
| 59 // Speech recognition in AppList is only for ChromeOS right now. | 60 // Speech recognition in AppList is only for ChromeOS right now. |
| 60 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 61 return true; | 62 return true; |
| 62 #else | 63 #else |
| 63 return false; | 64 return false; |
| 64 #endif | 65 #endif |
| 65 } | 66 } |
| 66 | 67 |
| 67 bool IsAppInfoEnabled() { | 68 bool IsAppInfoEnabled() { |
| 68 #if defined(TOOLKIT_VIEWS) | 69 #if defined(TOOLKIT_VIEWS) |
| 69 return !CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo); | 70 return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableAppInfo); |
| 70 #else | 71 #else |
| 71 return false; | 72 return false; |
| 72 #endif | 73 #endif |
| 73 } | 74 } |
| 74 | 75 |
| 75 bool IsExperimentalAppListEnabled() { | 76 bool IsExperimentalAppListEnabled() { |
| 76 if (CommandLine::ForCurrentProcess()->HasSwitch(kEnableExperimentalAppList)) | 77 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 78 kEnableExperimentalAppList)) |
| 77 return true; | 79 return true; |
| 78 | 80 |
| 79 if (CommandLine::ForCurrentProcess()->HasSwitch(kDisableExperimentalAppList)) | 81 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 82 kDisableExperimentalAppList)) |
| 80 return false; | 83 return false; |
| 81 | 84 |
| 82 #if defined(OS_CHROMEOS) | 85 #if defined(OS_CHROMEOS) |
| 83 return true; | 86 return true; |
| 84 #else | 87 #else |
| 85 return false; | 88 return false; |
| 86 #endif | 89 #endif |
| 87 } | 90 } |
| 88 | 91 |
| 89 bool IsCenteredAppListEnabled() { | 92 bool IsCenteredAppListEnabled() { |
| 90 return CommandLine::ForCurrentProcess()->HasSwitch(kEnableCenteredAppList) || | 93 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 94 kEnableCenteredAppList) || |
| 91 IsExperimentalAppListEnabled(); | 95 IsExperimentalAppListEnabled(); |
| 92 } | 96 } |
| 93 | 97 |
| 94 bool ShouldNotDismissOnBlur() { | 98 bool ShouldNotDismissOnBlur() { |
| 95 return CommandLine::ForCurrentProcess()->HasSwitch( | 99 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 96 kDisableAppListDismissOnBlur); | 100 kDisableAppListDismissOnBlur); |
| 97 } | 101 } |
| 98 | 102 |
| 99 bool IsDriveAppsInAppListEnabled() { | 103 bool IsDriveAppsInAppListEnabled() { |
| 100 #if defined(OS_CHROMEOS) | 104 #if defined(OS_CHROMEOS) |
| 101 return !CommandLine::ForCurrentProcess()->HasSwitch( | 105 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 102 kDisableDriveAppsInAppList); | 106 kDisableDriveAppsInAppList); |
| 103 #else | 107 #else |
| 104 return false; | 108 return false; |
| 105 #endif | 109 #endif |
| 106 } | 110 } |
| 107 | 111 |
| 108 } // namespace switches | 112 } // namespace switches |
| 109 } // namespace app_list | 113 } // namespace app_list |
| OLD | NEW |