| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/autofill/core/browser/autofill_field_trial_ios.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "base/metrics/field_trial.h" | |
| 9 #include "components/autofill/core/common/autofill_switches.h" | |
| 10 | |
| 11 namespace autofill { | |
| 12 | |
| 13 // The full-form Autofill field trial name. | |
| 14 const char kFullFormFieldTrialName[] = "FullFormAutofill"; | |
| 15 | |
| 16 // static | |
| 17 bool AutofillFieldTrialIOS::IsFullFormAutofillEnabled() { | |
| 18 // Query the field trial state first to ensure that UMA reports the correct | |
| 19 // group. | |
| 20 std::string field_trial_state = | |
| 21 base::FieldTrialList::FindFullName(kFullFormFieldTrialName); | |
| 22 | |
| 23 const base::CommandLine* command_line = | |
| 24 base::CommandLine::ForCurrentProcess(); | |
| 25 if (command_line->HasSwitch(switches::kDisableFullFormAutofillIOS)) | |
| 26 return false; | |
| 27 if (command_line->HasSwitch(switches::kEnableFullFormAutofillIOS)) | |
| 28 return true; | |
| 29 | |
| 30 return !field_trial_state.empty() && field_trial_state != "Disabled"; | |
| 31 } | |
| 32 | |
| 33 } // namespace autofill | |
| OLD | NEW |