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

Unified Diff: chrome/renderer/autofill/autofill_agent.cc

Issue 10443084: Add Datalist Support to New Autofill UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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/renderer/autofill/autofill_agent.cc
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc
index e51eaf8144a3406c3cdc9a30f21412fe0fa1e528..21f0cc16d22c2cf46d1dc3a7706ba8b2d5eb7a3b 100644
--- a/chrome/renderer/autofill/autofill_agent.cc
+++ b/chrome/renderer/autofill/autofill_agent.cc
@@ -125,6 +125,8 @@ bool AutofillAgent::OnMessageReceived(const IPC::Message& message) {
OnClearPreviewedForm)
IPC_MESSAGE_HANDLER(AutofillMsg_SetNodeText,
OnSetNodeText)
+ IPC_MESSAGE_HANDLER(AutofillMsg_AcceptDataListSuggestion,
+ OnAcceptDataListSuggestion)
IPC_MESSAGE_HANDLER(AutofillMsg_AcceptPasswordAutofillSuggestion,
OnAcceptPasswordAutofillSuggestion)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -523,6 +525,10 @@ void AutofillAgent::OnSetNodeText(const string16& value) {
SetNodeText(value, &element_);
}
+void AutofillAgent::OnAcceptDataListSuggestion(const string16& value) {
+ AcceptDataListSuggestion(value);
+}
+
void AutofillAgent::OnAcceptPasswordAutofillSuggestion(const string16& value) {
// We need to make sure this is handled here because the browser process
// skipped it handling because it believed it would be handled here. If it
@@ -594,6 +600,23 @@ void AutofillAgent::QueryAutofillSuggestions(const WebInputElement& element,
gfx::Rect bounding_box(element_.boundsInViewportSpace());
+ // Find the datalist values and send them to the the browser process.
+ std::vector<string16> data_list_values;
+ std::vector<string16> data_list_labels;
+ std::vector<string16> data_list_icons;
+ std::vector<int> data_list_unique_ids;
+ AppendDataListSuggestions(element_,
+ &data_list_values,
+ &data_list_labels,
+ &data_list_icons,
+ &data_list_unique_ids);
+
+ Send(new AutofillHostMsg_SetDataList(routing_id(),
+ data_list_values,
+ data_list_labels,
+ data_list_icons,
+ data_list_unique_ids));
+
Send(new AutofillHostMsg_QueryFormFieldAutofill(routing_id(),
autofill_query_id_,
form,
« chrome/common/autofill_messages.h ('K') | « chrome/renderer/autofill/autofill_agent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698