OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This file can be empty. Its purpose is to contain the relatively short lived | 5 // This file can be empty. Its purpose is to contain the relatively short lived |
6 // definitions required for experimental flags. | 6 // definitions required for experimental flags. |
7 | 7 |
8 #include "ios/chrome/browser/experimental_flags.h" | 8 #include "ios/chrome/browser/experimental_flags.h" |
9 | 9 |
10 #include <dispatch/dispatch.h> | 10 #include <dispatch/dispatch.h> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #error "This file requires ARC support." | 26 #error "This file requires ARC support." |
27 #endif | 27 #endif |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 NSString* const kEnableAlertOnBackgroundUpload = | 31 NSString* const kEnableAlertOnBackgroundUpload = |
32 @"EnableAlertsOnBackgroundUpload"; | 32 @"EnableAlertsOnBackgroundUpload"; |
33 NSString* const kEnableNewClearBrowsingDataUI = @"EnableNewClearBrowsingDataUI"; | 33 NSString* const kEnableNewClearBrowsingDataUI = @"EnableNewClearBrowsingDataUI"; |
34 NSString* const kEnableStartupCrash = @"EnableStartupCrash"; | 34 NSString* const kEnableStartupCrash = @"EnableStartupCrash"; |
35 NSString* const kEnableViewCopyPasswords = @"EnableViewCopyPasswords"; | 35 NSString* const kEnableViewCopyPasswords = @"EnableViewCopyPasswords"; |
36 NSString* const kExternalAppPromptDisabled = @"ExternalAppPromptDisabled"; | |
37 NSString* const kFirstRunForceEnabled = @"FirstRunForceEnabled"; | 36 NSString* const kFirstRunForceEnabled = @"FirstRunForceEnabled"; |
38 NSString* const kForceResetContextualSearch = @"ForceResetContextualSearch"; | 37 NSString* const kForceResetContextualSearch = @"ForceResetContextualSearch"; |
39 NSString* const kGaiaEnvironment = @"GAIAEnvironment"; | 38 NSString* const kGaiaEnvironment = @"GAIAEnvironment"; |
40 NSString* const kHeuristicsForPasswordGeneration = | 39 NSString* const kHeuristicsForPasswordGeneration = |
41 @"HeuristicsForPasswordGeneration"; | 40 @"HeuristicsForPasswordGeneration"; |
42 NSString* const kMDMIntegrationDisabled = @"MDMIntegrationDisabled"; | 41 NSString* const kMDMIntegrationDisabled = @"MDMIntegrationDisabled"; |
43 NSString* const kOriginServerHost = @"AlternateOriginServerHost"; | 42 NSString* const kOriginServerHost = @"AlternateOriginServerHost"; |
44 NSString* const kSafariVCSignInDisabled = @"SafariVCSignInDisabled"; | 43 NSString* const kSafariVCSignInDisabled = @"SafariVCSignInDisabled"; |
45 NSString* const kWhatsNewPromoStatus = @"WhatsNewPromoStatus"; | 44 NSString* const kWhatsNewPromoStatus = @"WhatsNewPromoStatus"; |
46 | 45 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 std::string group_name = base::FieldTrialList::FindFullName("IOSAutoReload"); | 91 std::string group_name = base::FieldTrialList::FindFullName("IOSAutoReload"); |
93 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 92 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
94 if (command_line->HasSwitch(switches::kEnableOfflineAutoReload)) | 93 if (command_line->HasSwitch(switches::kEnableOfflineAutoReload)) |
95 return true; | 94 return true; |
96 if (command_line->HasSwitch(switches::kDisableOfflineAutoReload)) | 95 if (command_line->HasSwitch(switches::kDisableOfflineAutoReload)) |
97 return false; | 96 return false; |
98 return base::StartsWith(group_name, "Enabled", | 97 return base::StartsWith(group_name, "Enabled", |
99 base::CompareCase::INSENSITIVE_ASCII); | 98 base::CompareCase::INSENSITIVE_ASCII); |
100 } | 99 } |
101 | 100 |
102 bool IsExternalApplicationPromptEnabled() { | |
103 return ![[NSUserDefaults standardUserDefaults] | |
104 boolForKey:kExternalAppPromptDisabled]; | |
105 } | |
106 | |
107 bool IsForceResetContextualSearchEnabled() { | 101 bool IsForceResetContextualSearchEnabled() { |
108 return [[NSUserDefaults standardUserDefaults] | 102 return [[NSUserDefaults standardUserDefaults] |
109 boolForKey:kForceResetContextualSearch]; | 103 boolForKey:kForceResetContextualSearch]; |
110 } | 104 } |
111 | 105 |
112 bool IsLRUSnapshotCacheEnabled() { | 106 bool IsLRUSnapshotCacheEnabled() { |
113 // Check if the experimental flag is forced on or off. | 107 // Check if the experimental flag is forced on or off. |
114 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 108 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
115 if (command_line->HasSwitch(switches::kEnableLRUSnapshotCache)) { | 109 if (command_line->HasSwitch(switches::kEnableLRUSnapshotCache)) { |
116 return true; | 110 return true; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 return base::StartsWith(group_name, "Enabled", | 261 return base::StartsWith(group_name, "Enabled", |
268 base::CompareCase::INSENSITIVE_ASCII); | 262 base::CompareCase::INSENSITIVE_ASCII); |
269 } | 263 } |
270 | 264 |
271 bool IsNativeAppLauncherEnabled() { | 265 bool IsNativeAppLauncherEnabled() { |
272 return [[NSUserDefaults standardUserDefaults] | 266 return [[NSUserDefaults standardUserDefaults] |
273 boolForKey:@"NativeAppLauncherEnabled"]; | 267 boolForKey:@"NativeAppLauncherEnabled"]; |
274 } | 268 } |
275 | 269 |
276 } // namespace experimental_flags | 270 } // namespace experimental_flags |
OLD | NEW |