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