OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/public/test/test_browser_context.h" | 5 #include "content/public/test/test_browser_context.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/test/null_task_runner.h" | 10 #include "base/test/null_task_runner.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 permission_manager_ = std::move(permission_manager); | 67 permission_manager_ = std::move(permission_manager); |
68 } | 68 } |
69 | 69 |
70 net::URLRequestContextGetter* TestBrowserContext::GetRequestContext() { | 70 net::URLRequestContextGetter* TestBrowserContext::GetRequestContext() { |
71 if (!request_context_.get()) { | 71 if (!request_context_.get()) { |
72 request_context_ = new TestContextURLRequestContextGetter(); | 72 request_context_ = new TestContextURLRequestContextGetter(); |
73 } | 73 } |
74 return request_context_.get(); | 74 return request_context_.get(); |
75 } | 75 } |
76 | 76 |
| 77 void TestBrowserContext::SetOffTheRecord(bool is_off_the_record) { |
| 78 is_off_the_record_ = is_off_the_record; |
| 79 } |
| 80 |
77 base::FilePath TestBrowserContext::GetPath() const { | 81 base::FilePath TestBrowserContext::GetPath() const { |
78 return browser_context_dir_.GetPath(); | 82 return browser_context_dir_.GetPath(); |
79 } | 83 } |
80 | 84 |
81 std::unique_ptr<ZoomLevelDelegate> TestBrowserContext::CreateZoomLevelDelegate( | 85 std::unique_ptr<ZoomLevelDelegate> TestBrowserContext::CreateZoomLevelDelegate( |
82 const base::FilePath& partition_path) { | 86 const base::FilePath& partition_path) { |
83 return std::unique_ptr<ZoomLevelDelegate>(); | 87 return std::unique_ptr<ZoomLevelDelegate>(); |
84 } | 88 } |
85 | 89 |
86 bool TestBrowserContext::IsOffTheRecord() const { | 90 bool TestBrowserContext::IsOffTheRecord() const { |
87 return false; | 91 return is_off_the_record_; |
88 } | 92 } |
89 | 93 |
90 DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { | 94 DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { |
91 return NULL; | 95 return NULL; |
92 } | 96 } |
93 | 97 |
94 ResourceContext* TestBrowserContext::GetResourceContext() { | 98 ResourceContext* TestBrowserContext::GetResourceContext() { |
95 if (!resource_context_) | 99 if (!resource_context_) |
96 resource_context_.reset(new MockResourceContext( | 100 resource_context_.reset(new MockResourceContext( |
97 GetRequestContext()->GetURLRequestContext())); | 101 GetRequestContext()->GetURLRequestContext())); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 151 } |
148 | 152 |
149 net::URLRequestContextGetter* | 153 net::URLRequestContextGetter* |
150 TestBrowserContext::CreateMediaRequestContextForStoragePartition( | 154 TestBrowserContext::CreateMediaRequestContextForStoragePartition( |
151 const base::FilePath& partition_path, | 155 const base::FilePath& partition_path, |
152 bool in_memory) { | 156 bool in_memory) { |
153 return NULL; | 157 return NULL; |
154 } | 158 } |
155 | 159 |
156 } // namespace content | 160 } // namespace content |
OLD | NEW |