OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/content/browser/content_autofill_driver.h" | 5 #include "components/autofill/content/browser/content_autofill_driver.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 content::RenderFrameHost* render_frame_host, | 33 content::RenderFrameHost* render_frame_host, |
34 AutofillClient* client, | 34 AutofillClient* client, |
35 const std::string& app_locale, | 35 const std::string& app_locale, |
36 AutofillManager::AutofillDownloadManagerState enable_download_manager) | 36 AutofillManager::AutofillDownloadManagerState enable_download_manager) |
37 : render_frame_host_(render_frame_host), | 37 : render_frame_host_(render_frame_host), |
38 client_(client), | 38 client_(client), |
39 autofill_manager_(new AutofillManager(this, | 39 autofill_manager_(new AutofillManager(this, |
40 client, | 40 client, |
41 app_locale, | 41 app_locale, |
42 enable_download_manager)), | 42 enable_download_manager)), |
43 autofill_external_delegate_(autofill_manager_.get(), this), | 43 autofill_external_delegate_(autofill_manager_.get(), this) { |
44 request_autocomplete_manager_(this) { | |
45 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); | 44 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); |
46 | 45 |
47 // ContentAutofillDriver is guaranteed to outlive |render_frame_host|, | 46 // ContentAutofillDriver is guaranteed to outlive |render_frame_host|, |
48 // as the ContentAutofillDriver instance will be destroyed in | 47 // as the ContentAutofillDriver instance will be destroyed in |
49 // ContentAutofillDriverFactory::RenderFrameDeleted, which is a notification | 48 // ContentAutofillDriverFactory::RenderFrameDeleted, which is a notification |
50 // of |render_frame_host| destruction. | 49 // of |render_frame_host| destruction. |
51 render_frame_host->GetServiceRegistry()->AddService( | 50 render_frame_host->GetServiceRegistry()->AddService( |
52 base::Bind(&ContentAutofillDriver::BindRequest, base::Unretained(this))); | 51 base::Bind(&ContentAutofillDriver::BindRequest, base::Unretained(this))); |
53 } | 52 } |
54 | 53 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 AutofillManager::OnDidFillAutofillFormData) | 210 AutofillManager::OnDidFillAutofillFormData) |
212 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidEndTextFieldEditing, | 211 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidEndTextFieldEditing, |
213 autofill_manager_.get(), | 212 autofill_manager_.get(), |
214 AutofillManager::OnDidEndTextFieldEditing) | 213 AutofillManager::OnDidEndTextFieldEditing) |
215 IPC_MESSAGE_FORWARD(AutofillHostMsg_HidePopup, | 214 IPC_MESSAGE_FORWARD(AutofillHostMsg_HidePopup, |
216 autofill_manager_.get(), | 215 autofill_manager_.get(), |
217 AutofillManager::OnHidePopup) | 216 AutofillManager::OnHidePopup) |
218 IPC_MESSAGE_FORWARD(AutofillHostMsg_SetDataList, | 217 IPC_MESSAGE_FORWARD(AutofillHostMsg_SetDataList, |
219 autofill_manager_.get(), | 218 autofill_manager_.get(), |
220 AutofillManager::OnSetDataList) | 219 AutofillManager::OnSetDataList) |
221 IPC_MESSAGE_FORWARD(AutofillHostMsg_RequestAutocomplete, | |
222 &request_autocomplete_manager_, | |
223 RequestAutocompleteManager::OnRequestAutocomplete) | |
224 IPC_MESSAGE_UNHANDLED(handled = false) | 220 IPC_MESSAGE_UNHANDLED(handled = false) |
225 IPC_END_MESSAGE_MAP() | 221 IPC_END_MESSAGE_MAP() |
226 return handled; | 222 return handled; |
227 } | 223 } |
228 | 224 |
229 void ContentAutofillDriver::DidNavigateFrame( | 225 void ContentAutofillDriver::DidNavigateFrame( |
230 const content::LoadCommittedDetails& details, | 226 const content::LoadCommittedDetails& details, |
231 const content::FrameNavigateParams& params) { | 227 const content::FrameNavigateParams& params) { |
232 if (details.is_navigation_to_different_page()) | 228 if (details.is_navigation_to_different_page()) |
233 autofill_manager_->Reset(); | 229 autofill_manager_->Reset(); |
(...skipping 12 matching lines...) Expand all Loading... |
246 | 242 |
247 void ContentAutofillDriver::ConnectToMojoAutofillAgentIfNeeded() { | 243 void ContentAutofillDriver::ConnectToMojoAutofillAgentIfNeeded() { |
248 if (mojo_autofill_agent_) | 244 if (mojo_autofill_agent_) |
249 return; | 245 return; |
250 | 246 |
251 render_frame_host_->GetServiceRegistry()->ConnectToRemoteService( | 247 render_frame_host_->GetServiceRegistry()->ConnectToRemoteService( |
252 mojo::GetProxy(&mojo_autofill_agent_)); | 248 mojo::GetProxy(&mojo_autofill_agent_)); |
253 } | 249 } |
254 | 250 |
255 } // namespace autofill | 251 } // namespace autofill |
OLD | NEW |