| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 // Implementation of about_flags for iOS that sets flags based on experimental | 5 // Implementation of about_flags for iOS that sets flags based on experimental |
| 6 // settings. | 6 // settings. |
| 7 | 7 |
| 8 #include "ios/chrome/browser/about_flags.h" | 8 #include "ios/chrome/browser/about_flags.h" |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 int32_t major = 0; | 208 int32_t major = 0; |
| 209 int32_t minor = 0; | 209 int32_t minor = 0; |
| 210 int32_t bugfix = 0; | 210 int32_t bugfix = 0; |
| 211 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); | 211 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 212 std::string product = base::StringPrintf("Version/%d.%d", major, minor); | 212 std::string product = base::StringPrintf("Version/%d.%d", major, minor); |
| 213 | 213 |
| 214 command_line->AppendSwitchASCII(switches::kUserAgent, | 214 command_line->AppendSwitchASCII(switches::kUserAgent, |
| 215 web::BuildUserAgentFromProduct(product)); | 215 web::BuildUserAgentFromProduct(product)); |
| 216 } | 216 } |
| 217 | 217 |
| 218 // Populate command line flags from QRScanner. | |
| 219 if ([defaults boolForKey:@"DisableQRCodeReader"]) { | |
| 220 command_line->AppendSwitch(switches::kDisableQRScanner); | |
| 221 } else { | |
| 222 command_line->AppendSwitch(switches::kEnableQRScanner); | |
| 223 } | |
| 224 | |
| 225 // Populate command line flag for the Payment Request API. | 218 // Populate command line flag for the Payment Request API. |
| 226 NSString* enable_payment_request = | 219 NSString* enable_payment_request = |
| 227 [defaults stringForKey:@"EnablePaymentRequest"]; | 220 [defaults stringForKey:@"EnablePaymentRequest"]; |
| 228 if ([enable_payment_request isEqualToString:@"Enabled"]) { | 221 if ([enable_payment_request isEqualToString:@"Enabled"]) { |
| 229 command_line->AppendSwitch(switches::kEnablePaymentRequest); | 222 command_line->AppendSwitch(switches::kEnablePaymentRequest); |
| 230 } else if ([enable_payment_request isEqualToString:@"Disabled"]) { | 223 } else if ([enable_payment_request isEqualToString:@"Disabled"]) { |
| 231 command_line->AppendSwitch(switches::kDisablePaymentRequest); | 224 command_line->AppendSwitch(switches::kDisablePaymentRequest); |
| 232 } | 225 } |
| 233 | 226 |
| 234 // Populate command line flag for Spotlight Actions. | 227 // Populate command line flag for Spotlight Actions. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 332 } |
| 340 | 333 |
| 341 namespace testing { | 334 namespace testing { |
| 342 | 335 |
| 343 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { | 336 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
| 344 *count = arraysize(kFeatureEntries); | 337 *count = arraysize(kFeatureEntries); |
| 345 return kFeatureEntries; | 338 return kFeatureEntries; |
| 346 } | 339 } |
| 347 | 340 |
| 348 } // namespace testing | 341 } // namespace testing |
| OLD | NEW |