Index: components/autofill/renderer/form_autofill_util.cc |
diff --git a/components/autofill/renderer/form_autofill_util.cc b/components/autofill/renderer/form_autofill_util.cc |
index 2d255df9dccb47500ee52dd06e6a9cb9f4e06a3f..a493b045b7e477a90fa8633bd917ddcac653bfd6 100644 |
--- a/components/autofill/renderer/form_autofill_util.cc |
+++ b/components/autofill/renderer/form_autofill_util.cc |
@@ -9,6 +9,7 @@ |
#include "base/command_line.h" |
#include "base/logging.h" |
#include "base/memory/scoped_vector.h" |
+#include "base/metrics/field_trial.h" |
#include "base/string_util.h" |
#include "base/utf_string_conversions.h" |
#include "components/autofill/common/autofill_switches.h" |
@@ -80,14 +81,18 @@ bool IsAutofillableElement(const WebFormControlElement& element) { |
return IsAutofillableInputElement(input_element) || IsSelectElement(element); |
} |
+bool IsAutocheckoutEnabled() { |
+ return base::FieldTrialList::FindFullName("Autocheckout") == "Yes" || |
Ilya Sherman
2013/04/13 01:12:09
I'm not sure that all field trials are automatical
Alexei Svitkine (slow)
2013/04/15 15:24:13
I believe we only tell the renderer of studies tha
Raman Kakilate
2013/04/15 15:49:52
Done. Verified that Autocheckout field trial is in
|
+ CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableExperimentalFormFilling); |
+} |
+ |
// Check whether the given field satisfies the REQUIRE_AUTOCOMPLETE requirement. |
// When Autocheckout is enabled, this requirement is enforced in the browser |
// process rather than in the renderer process, and hence all fields are |
// considered to satisfy this requirement. |
bool SatisfiesRequireAutocomplete(const WebInputElement& input_element) { |
- return input_element.autoComplete() || |
- CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableExperimentalFormFilling); |
+ return input_element.autoComplete() || IsAutocheckoutEnabled(); |
} |
// Appends |suffix| to |prefix| so that any intermediary whitespace is collapsed |