| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 int32_t major = 0; | 220 int32_t major = 0; |
| 221 int32_t minor = 0; | 221 int32_t minor = 0; |
| 222 int32_t bugfix = 0; | 222 int32_t bugfix = 0; |
| 223 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); | 223 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 224 std::string product = base::StringPrintf("Version/%d.%d", major, minor); | 224 std::string product = base::StringPrintf("Version/%d.%d", major, minor); |
| 225 | 225 |
| 226 command_line->AppendSwitchASCII(switches::kUserAgent, | 226 command_line->AppendSwitchASCII(switches::kUserAgent, |
| 227 web::BuildUserAgentFromProduct(product)); | 227 web::BuildUserAgentFromProduct(product)); |
| 228 } | 228 } |
| 229 | 229 |
| 230 // Populate command line flags from QRScanner. | |
| 231 if ([defaults boolForKey:@"DisableQRCodeReader"]) { | |
| 232 command_line->AppendSwitch(switches::kDisableQRScanner); | |
| 233 } else { | |
| 234 command_line->AppendSwitch(switches::kEnableQRScanner); | |
| 235 } | |
| 236 | |
| 237 // Populate command line flag for the Payment Request API. | 230 // Populate command line flag for the Payment Request API. |
| 238 NSString* enable_payment_request = | 231 NSString* enable_payment_request = |
| 239 [defaults stringForKey:@"EnablePaymentRequest"]; | 232 [defaults stringForKey:@"EnablePaymentRequest"]; |
| 240 if ([enable_payment_request isEqualToString:@"Enabled"]) { | 233 if ([enable_payment_request isEqualToString:@"Enabled"]) { |
| 241 command_line->AppendSwitch(switches::kEnablePaymentRequest); | 234 command_line->AppendSwitch(switches::kEnablePaymentRequest); |
| 242 } else if ([enable_payment_request isEqualToString:@"Disabled"]) { | 235 } else if ([enable_payment_request isEqualToString:@"Disabled"]) { |
| 243 command_line->AppendSwitch(switches::kDisablePaymentRequest); | 236 command_line->AppendSwitch(switches::kDisablePaymentRequest); |
| 244 } | 237 } |
| 245 | 238 |
| 246 // Populate command line flag for Spotlight Actions. | 239 // Populate command line flag for Spotlight Actions. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 336 } |
| 344 | 337 |
| 345 namespace testing { | 338 namespace testing { |
| 346 | 339 |
| 347 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { | 340 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
| 348 *count = arraysize(kFeatureEntries); | 341 *count = arraysize(kFeatureEntries); |
| 349 return kFeatureEntries; | 342 return kFeatureEntries; |
| 350 } | 343 } |
| 351 | 344 |
| 352 } // namespace testing | 345 } // namespace testing |
| OLD | NEW |