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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return path_; | 78 return path_; |
79 } | 79 } |
80 | 80 |
81 bool ShellBrowserContext::IsOffTheRecord() const { | 81 bool ShellBrowserContext::IsOffTheRecord() const { |
82 return off_the_record_; | 82 return off_the_record_; |
83 } | 83 } |
84 | 84 |
85 DownloadManagerDelegate* ShellBrowserContext::GetDownloadManagerDelegate() { | 85 DownloadManagerDelegate* ShellBrowserContext::GetDownloadManagerDelegate() { |
86 DownloadManager* manager = BrowserContext::GetDownloadManager(this); | 86 DownloadManager* manager = BrowserContext::GetDownloadManager(this); |
87 | 87 |
88 download_manager_delegate_ = new ShellDownloadManagerDelegate(); | 88 if (!download_manager_delegate_.get()) { |
89 download_manager_delegate_->SetDownloadManager(manager); | 89 download_manager_delegate_ = new ShellDownloadManagerDelegate(); |
| 90 download_manager_delegate_->SetDownloadManager(manager); |
| 91 } |
90 | 92 |
91 return download_manager_delegate_.get(); | 93 return download_manager_delegate_.get(); |
92 } | 94 } |
93 | 95 |
94 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { | 96 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { |
95 if (!url_request_getter_) { | 97 if (!url_request_getter_) { |
96 url_request_getter_ = new ShellURLRequestContextGetter( | 98 url_request_getter_ = new ShellURLRequestContextGetter( |
97 GetPath(), | 99 GetPath(), |
98 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), | 100 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), |
99 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE)); | 101 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE)); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 140 |
139 bool ShellBrowserContext::DidLastSessionExitCleanly() { | 141 bool ShellBrowserContext::DidLastSessionExitCleanly() { |
140 return true; | 142 return true; |
141 } | 143 } |
142 | 144 |
143 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { | 145 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { |
144 return NULL; | 146 return NULL; |
145 } | 147 } |
146 | 148 |
147 } // namespace content | 149 } // namespace content |
OLD | NEW |