| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/cookie_store_factory.h" |
| 15 #include "content/public/browser/resource_context.h" | 16 #include "content/public/browser/resource_context.h" |
| 16 #include "content/public/browser/storage_partition.h" | 17 #include "content/public/browser/storage_partition.h" |
| 17 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 18 #include "content/shell/common/shell_switches.h" | 19 #include "content/shell/common/shell_switches.h" |
| 19 #include "content/shell/shell_download_manager_delegate.h" | 20 #include "content/shell/shell_download_manager_delegate.h" |
| 20 #include "content/shell/shell_url_request_context_getter.h" | 21 #include "content/shell/shell_url_request_context_getter.h" |
| 21 | 22 |
| 22 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 23 #include "base/base_paths_win.h" | 24 #include "base/base_paths_win.h" |
| 24 #elif defined(OS_LINUX) | 25 #elif defined(OS_LINUX) |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 106 } |
| 106 | 107 |
| 107 base::FilePath ShellBrowserContext::GetPath() const { | 108 base::FilePath ShellBrowserContext::GetPath() const { |
| 108 return path_; | 109 return path_; |
| 109 } | 110 } |
| 110 | 111 |
| 111 bool ShellBrowserContext::IsOffTheRecord() const { | 112 bool ShellBrowserContext::IsOffTheRecord() const { |
| 112 return off_the_record_; | 113 return off_the_record_; |
| 113 } | 114 } |
| 114 | 115 |
| 116 CookieStoreConfig ShellBrowserContext::GetCookieStoreConfig() { |
| 117 return CookieStoreConfig::InMemory(); |
| 118 } |
| 119 |
| 115 DownloadManagerDelegate* ShellBrowserContext::GetDownloadManagerDelegate() { | 120 DownloadManagerDelegate* ShellBrowserContext::GetDownloadManagerDelegate() { |
| 116 DownloadManager* manager = BrowserContext::GetDownloadManager(this); | 121 DownloadManager* manager = BrowserContext::GetDownloadManager(this); |
| 117 | 122 |
| 118 if (!download_manager_delegate_.get()) { | 123 if (!download_manager_delegate_.get()) { |
| 119 download_manager_delegate_ = new ShellDownloadManagerDelegate(); | 124 download_manager_delegate_ = new ShellDownloadManagerDelegate(); |
| 120 download_manager_delegate_->SetDownloadManager(manager); | 125 download_manager_delegate_->SetDownloadManager(manager); |
| 121 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 126 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 122 if (cmd_line->HasSwitch(switches::kDumpRenderTree)) { | 127 if (cmd_line->HasSwitch(switches::kDumpRenderTree)) { |
| 123 download_manager_delegate_->SetDownloadBehaviorForTesting( | 128 download_manager_delegate_->SetDownloadBehaviorForTesting( |
| 124 path_.Append(FILE_PATH_LITERAL("downloads"))); | 129 path_.Append(FILE_PATH_LITERAL("downloads"))); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 GeolocationPermissionContext* | 205 GeolocationPermissionContext* |
| 201 ShellBrowserContext::GetGeolocationPermissionContext() { | 206 ShellBrowserContext::GetGeolocationPermissionContext() { |
| 202 return NULL; | 207 return NULL; |
| 203 } | 208 } |
| 204 | 209 |
| 205 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { | 210 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { |
| 206 return NULL; | 211 return NULL; |
| 207 } | 212 } |
| 208 | 213 |
| 209 } // namespace content | 214 } // namespace content |
| OLD | NEW |