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 23 matching lines...) Expand all Loading... |
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"; | 36 NSString* const kExternalAppPromptDisabled = @"ExternalAppPromptDisabled"; |
37 NSString* const kFirstRunForceEnabled = @"FirstRunForceEnabled"; | 37 NSString* const kFirstRunForceEnabled = @"FirstRunForceEnabled"; |
38 NSString* const kForceResetContextualSearch = @"ForceResetContextualSearch"; | 38 NSString* const kForceResetContextualSearch = @"ForceResetContextualSearch"; |
39 NSString* const kGaiaEnvironment = @"GAIAEnvironment"; | 39 NSString* const kGaiaEnvironment = @"GAIAEnvironment"; |
40 NSString* const kHeuristicsForPasswordGeneration = | 40 NSString* const kHeuristicsForPasswordGeneration = |
41 @"HeuristicsForPasswordGeneration"; | 41 @"HeuristicsForPasswordGeneration"; |
42 NSString* const kMDMIntegrationDisabled = @"MDMIntegrationDisabled"; | 42 NSString* const kMDMIntegrationDisabled = @"MDMIntegrationDisabled"; |
43 NSString* const kOriginServerHost = @"AlternateOriginServerHost"; | 43 NSString* const kOriginServerHost = @"AlternateOriginServerHost"; |
| 44 NSString* const kPendingIndexNavigationDisabled = |
| 45 @"PendingIndexNavigationDisabled"; |
44 NSString* const kSafariVCSignInDisabled = @"SafariVCSignInDisabled"; | 46 NSString* const kSafariVCSignInDisabled = @"SafariVCSignInDisabled"; |
45 NSString* const kWhatsNewPromoStatus = @"WhatsNewPromoStatus"; | 47 NSString* const kWhatsNewPromoStatus = @"WhatsNewPromoStatus"; |
46 | 48 |
47 const base::Feature kIOSDownloadImageRenaming{ | 49 const base::Feature kIOSDownloadImageRenaming{ |
48 "IOSDownloadImageRenaming", base::FEATURE_DISABLED_BY_DEFAULT}; | 50 "IOSDownloadImageRenaming", base::FEATURE_DISABLED_BY_DEFAULT}; |
49 | 51 |
50 } // namespace | 52 } // namespace |
51 | 53 |
52 namespace experimental_flags { | 54 namespace experimental_flags { |
53 | 55 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 return true; | 194 return true; |
193 } else if (command_line->HasSwitch(switches::kDisablePaymentRequest)) { | 195 } else if (command_line->HasSwitch(switches::kDisablePaymentRequest)) { |
194 return false; | 196 return false; |
195 } | 197 } |
196 | 198 |
197 // Check if the Finch experiment is turned on. | 199 // Check if the Finch experiment is turned on. |
198 return base::StartsWith(group_name, "Enabled", | 200 return base::StartsWith(group_name, "Enabled", |
199 base::CompareCase::INSENSITIVE_ASCII); | 201 base::CompareCase::INSENSITIVE_ASCII); |
200 } | 202 } |
201 | 203 |
| 204 bool IsPendingIndexNavigationEnabled() { |
| 205 return ![[NSUserDefaults standardUserDefaults] |
| 206 boolForKey:kPendingIndexNavigationDisabled]; |
| 207 } |
| 208 |
202 bool IsPhysicalWebEnabled() { | 209 bool IsPhysicalWebEnabled() { |
203 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 210 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
204 if (command_line->HasSwitch(switches::kEnableIOSPhysicalWeb)) { | 211 if (command_line->HasSwitch(switches::kEnableIOSPhysicalWeb)) { |
205 return true; | 212 return true; |
206 } else if (command_line->HasSwitch(switches::kDisableIOSPhysicalWeb)) { | 213 } else if (command_line->HasSwitch(switches::kDisableIOSPhysicalWeb)) { |
207 return false; | 214 return false; |
208 } | 215 } |
209 | 216 |
210 // Check if the finch experiment is turned on | 217 // Check if the finch experiment is turned on |
211 std::string group_name = | 218 std::string group_name = |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 return true; | 269 return true; |
263 | 270 |
264 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) | 271 if (command_line->HasSwitch(switches::kDisableSuggestionsUI)) |
265 return false; | 272 return false; |
266 | 273 |
267 // By default, disable it. | 274 // By default, disable it. |
268 return false; | 275 return false; |
269 } | 276 } |
270 | 277 |
271 } // namespace experimental_flags | 278 } // namespace experimental_flags |
OLD | NEW |