| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } // namespace | 253 } // namespace |
| 254 | 254 |
| 255 void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, | 255 void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, |
| 256 base::CommandLine* command_line) { | 256 base::CommandLine* command_line) { |
| 257 FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches( | 257 FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches( |
| 258 flags_storage, command_line, flags_ui::kAddSentinels, | 258 flags_storage, command_line, flags_ui::kAddSentinels, |
| 259 switches::kEnableIOSFeatures, switches::kDisableIOSFeatures); | 259 switches::kEnableIOSFeatures, switches::kDisableIOSFeatures); |
| 260 AppendSwitchesFromExperimentalSettings(command_line); | 260 AppendSwitchesFromExperimentalSettings(command_line); |
| 261 } | 261 } |
| 262 | 262 |
| 263 std::vector<std::string> RegisterAllFeatureVariationParameters( |
| 264 flags_ui::FlagsStorage* flags_storage, |
| 265 base::FeatureList* feature_list) { |
| 266 return FlagsStateSingleton::GetFlagsState() |
| 267 ->RegisterAllFeatureVariationParameters(flags_storage, feature_list); |
| 268 } |
| 269 |
| 263 void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage, | 270 void GetFlagFeatureEntries(flags_ui::FlagsStorage* flags_storage, |
| 264 flags_ui::FlagAccess access, | 271 flags_ui::FlagAccess access, |
| 265 base::ListValue* supported_entries, | 272 base::ListValue* supported_entries, |
| 266 base::ListValue* unsupported_entries) { | 273 base::ListValue* unsupported_entries) { |
| 267 FlagsStateSingleton::GetFlagsState()->GetFlagFeatureEntries( | 274 FlagsStateSingleton::GetFlagsState()->GetFlagFeatureEntries( |
| 268 flags_storage, access, supported_entries, unsupported_entries, | 275 flags_storage, access, supported_entries, unsupported_entries, |
| 269 base::Bind(&SkipConditionalFeatureEntry)); | 276 base::Bind(&SkipConditionalFeatureEntry)); |
| 270 } | 277 } |
| 271 | 278 |
| 272 void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage, | 279 void SetFeatureEntryEnabled(flags_ui::FlagsStorage* flags_storage, |
| 273 const std::string& internal_name, | 280 const std::string& internal_name, |
| 274 bool enable) { | 281 bool enable) { |
| 275 FlagsStateSingleton::GetFlagsState()->SetFeatureEntryEnabled( | 282 FlagsStateSingleton::GetFlagsState()->SetFeatureEntryEnabled( |
| 276 flags_storage, internal_name, enable); | 283 flags_storage, internal_name, enable); |
| 277 } | 284 } |
| 278 | 285 |
| 279 void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { | 286 void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { |
| 280 FlagsStateSingleton::GetFlagsState()->ResetAllFlags(flags_storage); | 287 FlagsStateSingleton::GetFlagsState()->ResetAllFlags(flags_storage); |
| 281 } | 288 } |
| 282 | 289 |
| 283 namespace testing { | 290 namespace testing { |
| 284 | 291 |
| 285 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { | 292 const flags_ui::FeatureEntry* GetFeatureEntries(size_t* count) { |
| 286 *count = arraysize(kFeatureEntries); | 293 *count = arraysize(kFeatureEntries); |
| 287 return kFeatureEntries; | 294 return kFeatureEntries; |
| 288 } | 295 } |
| 289 | 296 |
| 290 } // namespace testing | 297 } // namespace testing |
| OLD | NEW |