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

Unified Diff: chrome/browser/autofill/form_structure.cc

Issue 11867025: Download autocheckout whitelist and enable autocheckout for whitelisted sites only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
Index: chrome/browser/autofill/form_structure.cc
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc
index d1ca6d10bedf80cc2b56709590438e5c04e0025c..d742eeb4a80ce0055e1f13d2ef00b66b8191a67b 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -222,14 +222,15 @@ AutofillFieldType FieldTypeFromAutocompleteType(
} // namespace
-FormStructure::FormStructure(const FormData& form)
+FormStructure::FormStructure(const FormData& form, bool autocheckout_enabled)
: form_name_(form.name),
source_url_(form.origin),
target_url_(form.action),
autofill_count_(0),
upload_required_(USE_UPLOAD_RATES),
server_experiment_id_("no server response"),
- has_author_specified_types_(false) {
+ has_author_specified_types_(false),
+ autocheckout_enabled_(autocheckout_enabled) {
// Copy the form fields.
std::map<string16, size_t> unique_names;
for (std::vector<FormFieldData>::const_iterator field =
@@ -522,10 +523,7 @@ std::string FormStructure::FormSignature() const {
}
bool FormStructure::IsAutofillable(bool require_method_post) const {
- // TODO(ramankk): Remove this check once we have better way of identifying the
- // cases to trigger experimental form filling.
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExperimentalFormFilling))
+ if (autocheckout_enabled_)
return true;
if (autofill_count() < kRequiredFillableFields)
@@ -545,10 +543,7 @@ void FormStructure::UpdateAutofillCount() {
}
bool FormStructure::ShouldBeParsed(bool require_method_post) const {
- // TODO(ramankk): Remove this check once we have better way of identifying the
- // cases to trigger experimental form filling.
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExperimentalFormFilling))
+ if (autocheckout_enabled_)
return true;
if (field_count() < kRequiredFillableFields)

Powered by Google App Engine
This is Rietveld 408576698