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" |
11 #include "components/autofill/content/common/autofill_messages.h" | 11 #include "components/autofill/content/common/autofill_messages.h" |
12 #include "components/autofill/core/browser/autofill_client.h" | 12 #include "components/autofill/core/browser/autofill_client.h" |
13 #include "components/autofill/core/browser/autofill_external_delegate.h" | 13 #include "components/autofill/core/browser/autofill_external_delegate.h" |
14 #include "components/autofill/core/browser/autofill_manager.h" | 14 #include "components/autofill/core/browser/autofill_manager.h" |
15 #include "components/autofill/core/browser/form_structure.h" | 15 #include "components/autofill/core/browser/form_structure.h" |
16 #include "components/autofill/core/common/autofill_switches.h" | 16 #include "components/autofill/core/common/autofill_switches.h" |
17 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 #include "content/public/browser/navigation_controller.h" | 19 #include "content/public/browser/navigation_controller.h" |
20 #include "content/public/browser/navigation_details.h" | 20 #include "content/public/browser/navigation_details.h" |
21 #include "content/public/browser/render_frame_host.h" | 21 #include "content/public/browser/render_frame_host.h" |
22 #include "content/public/browser/render_view_host.h" | 22 #include "content/public/browser/render_view_host.h" |
23 #include "content/public/browser/render_widget_host_view.h" | 23 #include "content/public/browser/render_widget_host_view.h" |
24 #include "content/public/browser/site_instance.h" | 24 #include "content/public/browser/site_instance.h" |
| 25 #include "content/public/browser/storage_partition.h" |
25 #include "ipc/ipc_message_macros.h" | 26 #include "ipc/ipc_message_macros.h" |
26 #include "ui/gfx/geometry/size_f.h" | 27 #include "ui/gfx/geometry/size_f.h" |
27 | 28 |
28 namespace autofill { | 29 namespace autofill { |
29 | 30 |
30 ContentAutofillDriver::ContentAutofillDriver( | 31 ContentAutofillDriver::ContentAutofillDriver( |
31 content::RenderFrameHost* render_frame_host, | 32 content::RenderFrameHost* render_frame_host, |
32 AutofillClient* client, | 33 AutofillClient* client, |
33 const std::string& app_locale, | 34 const std::string& app_locale, |
34 AutofillManager::AutofillDownloadManagerState enable_download_manager) | 35 AutofillManager::AutofillDownloadManagerState enable_download_manager) |
(...skipping 10 matching lines...) Expand all Loading... |
45 | 46 |
46 ContentAutofillDriver::~ContentAutofillDriver() {} | 47 ContentAutofillDriver::~ContentAutofillDriver() {} |
47 | 48 |
48 bool ContentAutofillDriver::IsOffTheRecord() const { | 49 bool ContentAutofillDriver::IsOffTheRecord() const { |
49 return render_frame_host_->GetSiteInstance() | 50 return render_frame_host_->GetSiteInstance() |
50 ->GetBrowserContext() | 51 ->GetBrowserContext() |
51 ->IsOffTheRecord(); | 52 ->IsOffTheRecord(); |
52 } | 53 } |
53 | 54 |
54 net::URLRequestContextGetter* ContentAutofillDriver::GetURLRequestContext() { | 55 net::URLRequestContextGetter* ContentAutofillDriver::GetURLRequestContext() { |
55 return render_frame_host_->GetSiteInstance() | 56 return content::BrowserContext::GetDefaultStoragePartition( |
56 ->GetBrowserContext() | 57 render_frame_host_->GetSiteInstance()->GetBrowserContext())-> |
57 ->GetRequestContext(); | 58 GetURLRequestContext(); |
58 } | 59 } |
59 | 60 |
60 base::SequencedWorkerPool* ContentAutofillDriver::GetBlockingPool() { | 61 base::SequencedWorkerPool* ContentAutofillDriver::GetBlockingPool() { |
61 return content::BrowserThread::GetBlockingPool(); | 62 return content::BrowserThread::GetBlockingPool(); |
62 } | 63 } |
63 | 64 |
64 bool ContentAutofillDriver::RendererIsAvailable() { | 65 bool ContentAutofillDriver::RendererIsAvailable() { |
65 return render_frame_host_->GetRenderViewHost() != NULL; | 66 return render_frame_host_->GetRenderViewHost() != NULL; |
66 } | 67 } |
67 | 68 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 autofill_manager_->Reset(); | 218 autofill_manager_->Reset(); |
218 } | 219 } |
219 | 220 |
220 void ContentAutofillDriver::SetAutofillManager( | 221 void ContentAutofillDriver::SetAutofillManager( |
221 std::unique_ptr<AutofillManager> manager) { | 222 std::unique_ptr<AutofillManager> manager) { |
222 autofill_manager_ = std::move(manager); | 223 autofill_manager_ = std::move(manager); |
223 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); | 224 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); |
224 } | 225 } |
225 | 226 |
226 } // namespace autofill | 227 } // namespace autofill |
OLD | NEW |