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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
9 #include "components/autofill/content/common/autofill_messages.h" | 9 #include "components/autofill/content/common/autofill_messages.h" |
10 #include "components/autofill/core/browser/autofill_client.h" | 10 #include "components/autofill/core/browser/autofill_client.h" |
11 #include "components/autofill/core/browser/autofill_external_delegate.h" | 11 #include "components/autofill/core/browser/autofill_external_delegate.h" |
12 #include "components/autofill/core/browser/autofill_manager.h" | 12 #include "components/autofill/core/browser/autofill_manager.h" |
13 #include "components/autofill/core/browser/form_structure.h" | 13 #include "components/autofill/core/browser/form_structure.h" |
14 #include "components/autofill/core/common/autofill_switches.h" | 14 #include "components/autofill/core/common/autofill_switches.h" |
15 #include "content/public/browser/browser_context.h" | 15 #include "content/public/browser/browser_context.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/browser/navigation_controller.h" | 17 #include "content/public/browser/navigation_controller.h" |
18 #include "content/public/browser/navigation_details.h" | 18 #include "content/public/browser/navigation_details.h" |
19 #include "content/public/browser/render_frame_host.h" | 19 #include "content/public/browser/render_frame_host.h" |
20 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
21 #include "content/public/browser/site_instance.h" | 21 #include "content/public/browser/site_instance.h" |
22 #include "content/public/browser/web_contents.h" | |
22 #include "ipc/ipc_message_macros.h" | 23 #include "ipc/ipc_message_macros.h" |
23 | 24 |
24 namespace autofill { | 25 namespace autofill { |
25 | 26 |
26 ContentAutofillDriver::ContentAutofillDriver( | 27 ContentAutofillDriver::ContentAutofillDriver( |
27 content::RenderFrameHost* render_frame_host, | 28 content::RenderFrameHost* render_frame_host, |
28 AutofillClient* client, | 29 AutofillClient* client, |
29 const std::string& app_locale, | 30 const std::string& app_locale, |
30 AutofillManager::AutofillDownloadManagerState enable_download_manager) | 31 AutofillManager::AutofillDownloadManagerState enable_download_manager) |
31 : render_frame_host_(render_frame_host), | 32 : render_frame_host_(render_frame_host), |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 if (details.is_navigation_to_different_page()) | 198 if (details.is_navigation_to_different_page()) |
198 autofill_manager_->Reset(); | 199 autofill_manager_->Reset(); |
199 } | 200 } |
200 | 201 |
201 void ContentAutofillDriver::SetAutofillManager( | 202 void ContentAutofillDriver::SetAutofillManager( |
202 scoped_ptr<AutofillManager> manager) { | 203 scoped_ptr<AutofillManager> manager) { |
203 autofill_manager_ = manager.Pass(); | 204 autofill_manager_ = manager.Pass(); |
204 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); | 205 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); |
205 } | 206 } |
206 | 207 |
208 content::WebContents* ContentAutofillDriver::web_contents() { | |
209 return content::WebContents::FromRenderFrameHost(render_frame_host_); | |
210 } | |
211 | |
212 void ContentAutofillDriver::LinkClicked(const GURL& url, | |
Peter Kasting
2014/12/23 21:20:34
The order of functions in the .cc file should matc
Pritam Nikam
2014/12/24 11:16:57
Done.
| |
213 WindowOpenDisposition disposition) { | |
214 web_contents()->OpenURL(content::OpenURLParams( | |
215 url, content::Referrer(), disposition, ui::PAGE_TRANSITION_LINK, false)); | |
216 } | |
217 | |
207 } // namespace autofill | 218 } // namespace autofill |
OLD | NEW |