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

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

Issue 11348273: [autofill] Fill in values on a successful run of interactive autocomplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: estade@ review Created 8 years, 1 month 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 87c48f07c1eb19f58585f6c88584c1d640212970..a38efd0a44dd92174dc3c797a4d04d3b916061a1 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -522,7 +522,7 @@ 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))
+ switches::kEnableExperimentalFormFilling))
return true;
if (autofill_count() < kRequiredFillableFields)
@@ -545,7 +545,7 @@ 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))
+ switches::kEnableExperimentalFormFilling))
return true;
if (field_count() < kRequiredFillableFields)
@@ -814,6 +814,21 @@ std::string FormStructure::server_experiment_id() const {
return server_experiment_id_;
}
+FormData FormStructure::ToFormData() const {
+ // |data->user_submitted| will always be false.
+ FormData data;
+ data.name = form_name_;
+ data.origin = source_url_;
+ data.action = target_url_;
+ data.method = method_;
+
+ for (size_t i = 0; i < fields_.size(); ++i) {
+ data.fields.push_back(FormFieldData(*fields_[i]));
+ }
+
+ return data;
+}
+
bool FormStructure::operator==(const FormData& form) const {
// TODO(jhawkins): Is this enough to differentiate a form?
if (form_name_ == form.name &&

Powered by Google App Engine
This is Rietveld 408576698