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 26 matching lines...) Expand all Loading... |
37 NSString* const kForceResetContextualSearch = @"ForceResetContextualSearch"; | 37 NSString* const kForceResetContextualSearch = @"ForceResetContextualSearch"; |
38 NSString* const kGaiaEnvironment = @"GAIAEnvironment"; | 38 NSString* const kGaiaEnvironment = @"GAIAEnvironment"; |
39 NSString* const kHeuristicsForPasswordGeneration = | 39 NSString* const kHeuristicsForPasswordGeneration = |
40 @"HeuristicsForPasswordGeneration"; | 40 @"HeuristicsForPasswordGeneration"; |
41 NSString* const kMDMIntegrationDisabled = @"MDMIntegrationDisabled"; | 41 NSString* const kMDMIntegrationDisabled = @"MDMIntegrationDisabled"; |
42 NSString* const kOriginServerHost = @"AlternateOriginServerHost"; | 42 NSString* const kOriginServerHost = @"AlternateOriginServerHost"; |
43 NSString* const kSafariVCSignInDisabled = @"SafariVCSignInDisabled"; | 43 NSString* const kSafariVCSignInDisabled = @"SafariVCSignInDisabled"; |
44 NSString* const kWhatsNewPromoStatus = @"WhatsNewPromoStatus"; | 44 NSString* const kWhatsNewPromoStatus = @"WhatsNewPromoStatus"; |
45 const base::Feature kEnableSlimNavigationManager{ | 45 const base::Feature kEnableSlimNavigationManager{ |
46 "EnableSlimNavigationManager", base::FEATURE_DISABLED_BY_DEFAULT}; | 46 "EnableSlimNavigationManager", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 47 const base::Feature kEnableThirdPartyKeyboardWorkaround{ |
| 48 "EnableThirdPartyKeyboardWorkaround", base::FEATURE_ENABLED_BY_DEFAULT}; |
47 | 49 |
48 } // namespace | 50 } // namespace |
49 | 51 |
50 namespace experimental_flags { | 52 namespace experimental_flags { |
51 | 53 |
52 bool AlwaysDisplayFirstRun() { | 54 bool AlwaysDisplayFirstRun() { |
53 return | 55 return |
54 [[NSUserDefaults standardUserDefaults] boolForKey:kFirstRunForceEnabled]; | 56 [[NSUserDefaults standardUserDefaults] boolForKey:kFirstRunForceEnabled]; |
55 } | 57 } |
56 | 58 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (command_line->HasSwitch(switches::kEnableSlimNavigationManager)) { | 299 if (command_line->HasSwitch(switches::kEnableSlimNavigationManager)) { |
298 return true; | 300 return true; |
299 } else if (command_line->HasSwitch(switches::kDisableSlimNavigationManager)) { | 301 } else if (command_line->HasSwitch(switches::kDisableSlimNavigationManager)) { |
300 return false; | 302 return false; |
301 } | 303 } |
302 | 304 |
303 // Check if the Finch experiment is turned on. | 305 // Check if the Finch experiment is turned on. |
304 return base::FeatureList::IsEnabled(kEnableSlimNavigationManager); | 306 return base::FeatureList::IsEnabled(kEnableSlimNavigationManager); |
305 } | 307 } |
306 | 308 |
| 309 bool IsThirdPartyKeyboardWorkaroundEnabled() { |
| 310 // Check if the experimental flag is forced on or off. |
| 311 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 312 if (command_line->HasSwitch(switches::kEnableThirdPartyKeyboardWorkaround)) { |
| 313 return true; |
| 314 } else if (command_line->HasSwitch( |
| 315 switches::kDisableThirdPartyKeyboardWorkaround)) { |
| 316 return false; |
| 317 } |
| 318 |
| 319 // Check if the Finch experiment is turned on. |
| 320 return base::FeatureList::IsEnabled(kEnableThirdPartyKeyboardWorkaround); |
| 321 } |
| 322 |
307 } // namespace experimental_flags | 323 } // namespace experimental_flags |
OLD | NEW |