Index: components/autofill/ios/browser/autofill_field_trial_ios.cc |
diff --git a/components/autofill/ios/browser/autofill_field_trial_ios.cc b/components/autofill/ios/browser/autofill_field_trial_ios.cc |
index 5740f4d1624fcb2e847ac166ff52a28bb1a65db8..56a2d55e352a643a9cdda2f7d39e14791c4320f7 100644 |
--- a/components/autofill/ios/browser/autofill_field_trial_ios.cc |
+++ b/components/autofill/ios/browser/autofill_field_trial_ios.cc |
@@ -15,6 +15,11 @@ const char kFullFormFieldTrialName[] = "FullFormAutofill"; |
// static |
bool AutofillFieldTrialIOS::IsFullFormAutofillEnabled() { |
+ // Query the field trial state first to ensure that UMA reports the correct |
+ // group. |
+ std::string field_trial_state = |
+ base::FieldTrialList::FindFullName(kFullFormFieldTrialName); |
+ |
const base::CommandLine* command_line = |
base::CommandLine::ForCurrentProcess(); |
if (command_line->HasSwitch(autofill::switches::kDisableFullFormAutofillIOS)) |
@@ -22,8 +27,6 @@ bool AutofillFieldTrialIOS::IsFullFormAutofillEnabled() { |
if (command_line->HasSwitch(autofill::switches::kEnableFullFormAutofillIOS)) |
return true; |
- std::string field_trial_state = |
- base::FieldTrialList::FindFullName(kFullFormFieldTrialName); |
return !field_trial_state.empty() && field_trial_state != "Disabled"; |
} |