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/shell/shell_browser_context.h" | 5 #include "content/shell/shell_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/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 bool ShellBrowserContext::IsOffTheRecord() const { | 82 bool ShellBrowserContext::IsOffTheRecord() const { |
83 return off_the_record_; | 83 return off_the_record_; |
84 } | 84 } |
85 | 85 |
86 DownloadManagerDelegate* ShellBrowserContext::GetDownloadManagerDelegate() { | 86 DownloadManagerDelegate* ShellBrowserContext::GetDownloadManagerDelegate() { |
87 DownloadManager* manager = BrowserContext::GetDownloadManager(this); | 87 DownloadManager* manager = BrowserContext::GetDownloadManager(this); |
88 | 88 |
89 if (!download_manager_delegate_.get()) { | 89 if (!download_manager_delegate_.get()) { |
90 download_manager_delegate_ = new ShellDownloadManagerDelegate(); | 90 download_manager_delegate_ = new ShellDownloadManagerDelegate(); |
91 download_manager_delegate_->SetDownloadManager(manager); | 91 download_manager_delegate_->SetDownloadManager(manager); |
| 92 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 93 if (cmd_line->HasSwitch(switches::kDumpRenderTree)) { |
| 94 download_manager_delegate_->SetDownloadBehaviorForTesting( |
| 95 path_.Append(FILE_PATH_LITERAL("downloads"))); |
| 96 } |
92 } | 97 } |
93 | 98 |
94 return download_manager_delegate_.get(); | 99 return download_manager_delegate_.get(); |
95 } | 100 } |
96 | 101 |
97 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { | 102 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { |
98 if (!url_request_getter_) { | 103 if (!url_request_getter_) { |
99 url_request_getter_ = new ShellURLRequestContextGetter( | 104 url_request_getter_ = new ShellURLRequestContextGetter( |
100 ignore_certificate_errors_, | 105 ignore_certificate_errors_, |
101 GetPath(), | 106 GetPath(), |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 SpeechRecognitionPreferences* | 157 SpeechRecognitionPreferences* |
153 ShellBrowserContext::GetSpeechRecognitionPreferences() { | 158 ShellBrowserContext::GetSpeechRecognitionPreferences() { |
154 return NULL; | 159 return NULL; |
155 } | 160 } |
156 | 161 |
157 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { | 162 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { |
158 return NULL; | 163 return NULL; |
159 } | 164 } |
160 | 165 |
161 } // namespace content | 166 } // namespace content |
OLD | NEW |