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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "content/public/browser/resource_context.h" | 12 #include "content/public/browser/resource_context.h" |
13 #include "content/shell/browser/shell_download_manager_delegate.h" | 13 #include "content/shell/browser/layout_test/layout_test_download_manager_delegat e.h" |
14 #include "content/shell/browser/shell_url_request_context_getter.h" | 14 #include "content/shell/browser/shell_url_request_context_getter.h" |
15 | 15 |
16 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
17 #include "base/base_paths_win.h" | 17 #include "base/base_paths_win.h" |
18 #elif defined(OS_LINUX) | 18 #elif defined(OS_LINUX) |
19 #include "base/nix/xdg_util.h" | 19 #include "base/nix/xdg_util.h" |
20 #elif defined(OS_MACOSX) | 20 #elif defined(OS_MACOSX) |
21 #include "base/base_paths_mac.h" | 21 #include "base/base_paths_mac.h" |
22 #endif | 22 #endif |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 LayoutTestBrowserContext::LayoutTestBrowserContext(bool off_the_record, | 26 LayoutTestBrowserContext::LayoutTestBrowserContext(bool off_the_record, |
27 net::NetLog* net_log) | 27 net::NetLog* net_log) |
28 : ShellBrowserContext(off_the_record, net_log) { | 28 : ShellBrowserContext(off_the_record, net_log) { |
29 ignore_certificate_errors_ = true; | 29 ignore_certificate_errors_ = true; |
30 } | 30 } |
31 | 31 |
32 LayoutTestBrowserContext::~LayoutTestBrowserContext() { | 32 LayoutTestBrowserContext::~LayoutTestBrowserContext() { |
33 } | 33 } |
34 | 34 |
35 DownloadManagerDelegate* | 35 DownloadManagerDelegate* |
36 LayoutTestBrowserContext::GetDownloadManagerDelegate() { | 36 LayoutTestBrowserContext::GetDownloadManagerDelegate() { |
37 if (!download_manager_delegate_.get()) { | 37 if (!download_manager_delegate_.get()) { |
38 download_manager_delegate_.reset(new ShellDownloadManagerDelegate()); | 38 download_manager_delegate_.reset(new LayoutTestDownloadManagerDelegate()); |
39 download_manager_delegate_->SetDownloadManager( | 39 download_manager_delegate_->SetDownloadManager( |
40 BrowserContext::GetDownloadManager(this)); | 40 BrowserContext::GetDownloadManager(this)); |
41 // TODO(mkwst): We can avoid this bit in the future by defining a | |
42 // LayoutTestDownloadManagerDelegate. | |
Mike West
2014/10/10 11:11:47
We couldn't avoid this bit; I didn't notice that t
| |
43 download_manager_delegate_->SetDownloadBehaviorForTesting( | 41 download_manager_delegate_->SetDownloadBehaviorForTesting( |
44 GetPath().Append(FILE_PATH_LITERAL("downloads"))); | 42 GetPath().Append(FILE_PATH_LITERAL("downloads"))); |
45 } | 43 } |
46 | 44 |
47 return download_manager_delegate_.get(); | 45 return download_manager_delegate_.get(); |
48 } | 46 } |
49 | 47 |
50 } // namespace content | 48 } // namespace content |
OLD | NEW |