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

Unified Diff: components/autofill/content/browser/request_autocomplete_manager.cc

Issue 309063006: Do not autofill element when there is no autofill suggestion from profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update code as per further review comments. Created 6 years, 6 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: components/autofill/content/browser/request_autocomplete_manager.cc
diff --git a/components/autofill/content/browser/request_autocomplete_manager.cc b/components/autofill/content/browser/request_autocomplete_manager.cc
index cf4712bf6fa2c97cf97bea24613b66ab38cbdacb..8d6dc5a08fd2b0b49694962937b107dbffccd7ba 100644
--- a/components/autofill/content/browser/request_autocomplete_manager.cc
+++ b/components/autofill/content/browser/request_autocomplete_manager.cc
@@ -76,11 +76,20 @@ void RequestAutocompleteManager::ReturnAutocompleteResult(
if (!host)
return;
+ FormData form_data;
+ if (form_structure) {
+ form_data = form_structure->ToFormData();
+ for (size_t i = 0; i < form_data.fields.size(); ++i) {
+ if(!form_data.fields[i].value.empty())
+ form_data.fields[i].is_autofilled = true;
+ }
+ }
+
host->Send(new AutofillMsg_RequestAutocompleteResult(
host->GetRoutingID(),
ToWebkitAutocompleteResult(result),
debug_message,
- form_structure ? form_structure->ToFormData() : FormData()));
+ form_data));
}
void RequestAutocompleteManager::ShowRequestAutocompleteDialog(
« no previous file with comments | « chrome/renderer/autofill/form_autofill_browsertest.cc ('k') | components/autofill/content/renderer/form_autofill_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698