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

Unified Diff: components/autofill/renderer/form_autofill_util.cc

Issue 13811045: Autofill:Autocheckout: Enable Autocheckout for finch experimenting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indentation Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/browser/autofill_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..acdd8cca6dbf884a95600e3662a2d1f11f6a550d 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" ||
+ 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
« no previous file with comments | « components/autofill/browser/autofill_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698