Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: components/autofill/ios/browser/autofill_field_trial_ios.cc

Issue 1291073005: Update full-form autofill config to always query the field trial state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-flow comment text Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/metrics/field_trial.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #include "components/autofill/ios/browser/autofill_field_trial_ios.h" 5 #include "components/autofill/ios/browser/autofill_field_trial_ios.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "components/autofill/core/common/autofill_switches.h" 9 #include "components/autofill/core/common/autofill_switches.h"
10 10
11 namespace autofill { 11 namespace autofill {
12 12
13 // The full-form Autofill field trial name. 13 // The full-form Autofill field trial name.
14 const char kFullFormFieldTrialName[] = "FullFormAutofill"; 14 const char kFullFormFieldTrialName[] = "FullFormAutofill";
15 15
16 // static 16 // static
17 bool AutofillFieldTrialIOS::IsFullFormAutofillEnabled() { 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
18 const base::CommandLine* command_line = 23 const base::CommandLine* command_line =
19 base::CommandLine::ForCurrentProcess(); 24 base::CommandLine::ForCurrentProcess();
20 if (command_line->HasSwitch(autofill::switches::kDisableFullFormAutofillIOS)) 25 if (command_line->HasSwitch(autofill::switches::kDisableFullFormAutofillIOS))
21 return false; 26 return false;
22 if (command_line->HasSwitch(autofill::switches::kEnableFullFormAutofillIOS)) 27 if (command_line->HasSwitch(autofill::switches::kEnableFullFormAutofillIOS))
23 return true; 28 return true;
24 29
25 std::string field_trial_state =
26 base::FieldTrialList::FindFullName(kFullFormFieldTrialName);
27 return !field_trial_state.empty() && field_trial_state != "Disabled"; 30 return !field_trial_state.empty() && field_trial_state != "Disabled";
28 } 31 }
29 32
30 } // namespace autofill 33 } // namespace autofill
OLDNEW
« no previous file with comments | « base/metrics/field_trial.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698