| 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 "content/shell/browser/layout_test/layout_test_browser_context.h" | 5 #include "content/shell/browser/layout_test/layout_test_browser_context.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 10 #include "base/logging.h" | 12 #include "base/logging.h" |
| 11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 12 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/push_messaging_service.h" | 15 #include "content/public/browser/push_messaging_service.h" |
| 14 #include "content/public/browser/resource_context.h" | 16 #include "content/public/browser/resource_context.h" |
| 15 #include "content/shell/browser/layout_test/layout_test_download_manager_delegat
e.h" | 17 #include "content/shell/browser/layout_test/layout_test_download_manager_delegat
e.h" |
| 16 #include "content/shell/browser/layout_test/layout_test_permission_manager.h" | 18 #include "content/shell/browser/layout_test/layout_test_permission_manager.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 35 } | 37 } |
| 36 | 38 |
| 37 LayoutTestBrowserContext::~LayoutTestBrowserContext() { | 39 LayoutTestBrowserContext::~LayoutTestBrowserContext() { |
| 38 } | 40 } |
| 39 | 41 |
| 40 ShellURLRequestContextGetter* | 42 ShellURLRequestContextGetter* |
| 41 LayoutTestBrowserContext::CreateURLRequestContextGetter( | 43 LayoutTestBrowserContext::CreateURLRequestContextGetter( |
| 42 ProtocolHandlerMap* protocol_handlers, | 44 ProtocolHandlerMap* protocol_handlers, |
| 43 URLRequestInterceptorScopedVector request_interceptors) { | 45 URLRequestInterceptorScopedVector request_interceptors) { |
| 44 return new LayoutTestURLRequestContextGetter( | 46 return new LayoutTestURLRequestContextGetter( |
| 45 ignore_certificate_errors(), | 47 ignore_certificate_errors(), GetPath(), |
| 46 GetPath(), | |
| 47 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), | 48 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), |
| 48 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), | 49 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), |
| 49 protocol_handlers, | 50 protocol_handlers, std::move(request_interceptors), net_log()); |
| 50 request_interceptors.Pass(), | |
| 51 net_log()); | |
| 52 } | 51 } |
| 53 | 52 |
| 54 DownloadManagerDelegate* | 53 DownloadManagerDelegate* |
| 55 LayoutTestBrowserContext::GetDownloadManagerDelegate() { | 54 LayoutTestBrowserContext::GetDownloadManagerDelegate() { |
| 56 if (!download_manager_delegate_) { | 55 if (!download_manager_delegate_) { |
| 57 download_manager_delegate_.reset(new LayoutTestDownloadManagerDelegate()); | 56 download_manager_delegate_.reset(new LayoutTestDownloadManagerDelegate()); |
| 58 download_manager_delegate_->SetDownloadManager( | 57 download_manager_delegate_->SetDownloadManager( |
| 59 BrowserContext::GetDownloadManager(this)); | 58 BrowserContext::GetDownloadManager(this)); |
| 60 download_manager_delegate_->SetDownloadBehaviorForTesting( | 59 download_manager_delegate_->SetDownloadBehaviorForTesting( |
| 61 GetPath().Append(FILE_PATH_LITERAL("downloads"))); | 60 GetPath().Append(FILE_PATH_LITERAL("downloads"))); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 80 LayoutTestBrowserContext::GetBackgroundSyncController() { | 79 LayoutTestBrowserContext::GetBackgroundSyncController() { |
| 81 return nullptr; | 80 return nullptr; |
| 82 } | 81 } |
| 83 | 82 |
| 84 LayoutTestPermissionManager* | 83 LayoutTestPermissionManager* |
| 85 LayoutTestBrowserContext::GetLayoutTestPermissionManager() { | 84 LayoutTestBrowserContext::GetLayoutTestPermissionManager() { |
| 86 return static_cast<LayoutTestPermissionManager*>(GetPermissionManager()); | 85 return static_cast<LayoutTestPermissionManager*>(GetPermissionManager()); |
| 87 } | 86 } |
| 88 | 87 |
| 89 } // namespace content | 88 } // namespace content |
| OLD | NEW |