| 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> |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 #import <UIKit/UIKit.h> | 12 #import <UIKit/UIKit.h> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/singleton.h" | 18 #include "base/memory/singleton.h" |
| 19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 20 #include "base/strings/sys_string_conversions.h" | 20 #include "base/strings/sys_string_conversions.h" |
| 21 #include "base/sys_info.h" | 21 #include "base/sys_info.h" |
| 22 #include "base/task_scheduler/switches.h" | 22 #include "base/task_scheduler/switches.h" |
| 23 #include "components/dom_distiller/core/dom_distiller_switches.h" | 23 #include "components/dom_distiller/core/dom_distiller_switches.h" |
| 24 #include "components/flags_ui/feature_entry.h" | 24 #include "components/flags_ui/feature_entry.h" |
| 25 #include "components/flags_ui/feature_entry_macros.h" | 25 #include "components/flags_ui/feature_entry_macros.h" |
| 26 #include "components/flags_ui/flags_storage.h" | 26 #include "components/flags_ui/flags_storage.h" |
| 27 #include "components/flags_ui/flags_ui_switches.h" | 27 #include "components/flags_ui/flags_ui_switches.h" |
| 28 #include "components/ntp_tiles/switches.h" | 28 #include "components/ntp_tiles/switches.h" |
| 29 #include "components/reading_list/reading_list_switches.h" |
| 29 #include "components/strings/grit/components_strings.h" | 30 #include "components/strings/grit/components_strings.h" |
| 30 #include "components/sync/driver/sync_driver_switches.h" | 31 #include "components/sync/driver/sync_driver_switches.h" |
| 31 #include "google_apis/gaia/gaia_switches.h" | 32 #include "google_apis/gaia/gaia_switches.h" |
| 32 #include "ios/chrome/browser/chrome_switches.h" | 33 #include "ios/chrome/browser/chrome_switches.h" |
| 33 #include "ios/chrome/grit/ios_strings.h" | 34 #include "ios/chrome/grit/ios_strings.h" |
| 34 #include "ios/web/public/user_agent.h" | 35 #include "ios/web/public/user_agent.h" |
| 35 #include "ios/web/public/web_view_creation_util.h" | 36 #include "ios/web/public/web_view_creation_util.h" |
| 36 | 37 |
| 37 #if !defined(OFFICIAL_BUILD) | 38 #if !defined(OFFICIAL_BUILD) |
| 38 #include "components/variations/variations_switches.h" | 39 #include "components/variations/variations_switches.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 NSString* enable_payment_request = | 229 NSString* enable_payment_request = |
| 229 [defaults stringForKey:@"EnablePaymentRequest"]; | 230 [defaults stringForKey:@"EnablePaymentRequest"]; |
| 230 if ([enable_payment_request isEqualToString:@"Enabled"]) { | 231 if ([enable_payment_request isEqualToString:@"Enabled"]) { |
| 231 command_line->AppendSwitch(switches::kEnablePaymentRequest); | 232 command_line->AppendSwitch(switches::kEnablePaymentRequest); |
| 232 } else if ([enable_payment_request isEqualToString:@"Disabled"]) { | 233 } else if ([enable_payment_request isEqualToString:@"Disabled"]) { |
| 233 command_line->AppendSwitch(switches::kDisablePaymentRequest); | 234 command_line->AppendSwitch(switches::kDisablePaymentRequest); |
| 234 } | 235 } |
| 235 | 236 |
| 236 // Populate command line flags from Reading List. | 237 // Populate command line flags from Reading List. |
| 237 if ([defaults boolForKey:@"EnableReadingList"]) { | 238 if ([defaults boolForKey:@"EnableReadingList"]) { |
| 238 command_line->AppendSwitch(switches::kEnableReadingList); | 239 command_line->AppendSwitch(reading_list::switches::kEnableReadingList); |
| 239 } else { | 240 } else { |
| 240 command_line->AppendSwitch(switches::kDisableReadingList); | 241 command_line->AppendSwitch(reading_list::switches::kDisableReadingList); |
| 241 } | 242 } |
| 242 | 243 |
| 243 // Populate command line flag for Spotlight Actions. | 244 // Populate command line flag for Spotlight Actions. |
| 244 if ([defaults boolForKey:@"DisableSpotlightActions"]) { | 245 if ([defaults boolForKey:@"DisableSpotlightActions"]) { |
| 245 command_line->AppendSwitch(switches::kDisableSpotlightActions); | 246 command_line->AppendSwitch(switches::kDisableSpotlightActions); |
| 246 } | 247 } |
| 247 | 248 |
| 248 // Freeform commandline flags. These are added last, so that any flags added | 249 // Freeform commandline flags. These are added last, so that any flags added |
| 249 // earlier in this function take precedence. | 250 // earlier in this function take precedence. |
| 250 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) { | 251 if ([defaults boolForKey:@"EnableFreeformCommandLineFlags"]) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 331 } |
| 331 | 332 |
| 332 namespace testing { | 333 namespace testing { |
| 333 | 334 |
| 334 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { | 335 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
| 335 *count = arraysize(kFeatureEntries); | 336 *count = arraysize(kFeatureEntries); |
| 336 return kFeatureEntries; | 337 return kFeatureEntries; |
| 337 } | 338 } |
| 338 | 339 |
| 339 } // namespace testing | 340 } // namespace testing |
| OLD | NEW |