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, |