Index: components/autofill/content/browser/content_autofill_driver.cc |
diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc |
index ed4860c41c4950f551f7a83457684b3b12cb3780..c8943110d1503c44052feb30b6e1c250f5b5d123 100644 |
--- a/components/autofill/content/browser/content_autofill_driver.cc |
+++ b/components/autofill/content/browser/content_autofill_driver.cc |
@@ -83,10 +83,14 @@ void ContentAutofillDriver::SendFormDataToRenderer( |
const FormData& data) { |
if (!RendererIsAvailable()) |
return; |
+ |
+ ConnectToMojoAutofillAgentIfNeeded(); |
switch (action) { |
case FORM_DATA_ACTION_FILL: |
- render_frame_host_->Send(new AutofillMsg_FillForm( |
- render_frame_host_->GetRoutingID(), query_id, data)); |
+ mojo_autofill_agent_->FillForm( |
+ query_id, data, |
+ base::Bind(&ContentAutofillDriver::DidFillAutofillFormData, |
+ base::Unretained(this))); |
break; |
case FORM_DATA_ACTION_PREVIEW: |
render_frame_host_->Send(new AutofillMsg_PreviewForm( |
@@ -205,9 +209,6 @@ bool ContentAutofillDriver::HandleMessage(const IPC::Message& message) { |
IPC_MESSAGE_FORWARD(AutofillHostMsg_PingAck, |
&autofill_external_delegate_, |
AutofillExternalDelegate::OnPingAck) |
- IPC_MESSAGE_FORWARD(AutofillHostMsg_DidFillAutofillFormData, |
- autofill_manager_.get(), |
- AutofillManager::OnDidFillAutofillFormData) |
IPC_MESSAGE_FORWARD(AutofillHostMsg_DidEndTextFieldEditing, |
autofill_manager_.get(), |
AutofillManager::OnDidEndTextFieldEditing) |
@@ -240,6 +241,12 @@ void ContentAutofillDriver::NotifyFirstUserGestureObservedInTab() { |
mojo_autofill_agent_->FirstUserGestureObservedInTab(); |
} |
+void ContentAutofillDriver::DidFillAutofillFormData(const FormData& filled, |
+ int64_t timestamp) { |
+ autofill_manager_->OnDidFillAutofillFormData( |
+ filled, base::TimeTicks::FromInternalValue(timestamp)); |
+} |
+ |
void ContentAutofillDriver::ConnectToMojoAutofillAgentIfNeeded() { |
if (mojo_autofill_agent_) |
return; |