| 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/environment.h" | 8 #include "base/environment.h" |
| 9 #include "base/file_util.h" | 9 #include "base/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 "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 13 #include "content/public/browser/download_manager.h" | 13 #include "content/public/browser/download_manager.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/geolocation_permission_context.h" | 15 #include "content/public/browser/geolocation_permission_context.h" |
| 16 #include "content/public/browser/speech_recognition_preferences.h" | 16 #include "content/public/browser/speech_recognition_preferences.h" |
| 17 #include "content/shell/shell_browser_main_parts.h" | |
| 18 #include "content/shell/shell_download_manager_delegate.h" | 17 #include "content/shell/shell_download_manager_delegate.h" |
| 19 #include "content/shell/shell_resource_context.h" | 18 #include "content/shell/shell_resource_context.h" |
| 20 #include "content/shell/shell_url_request_context_getter.h" | 19 #include "content/shell/shell_url_request_context_getter.h" |
| 21 | 20 |
| 22 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 23 #include "base/base_paths_win.h" | 22 #include "base/base_paths_win.h" |
| 24 #elif defined(OS_LINUX) | 23 #elif defined(OS_LINUX) |
| 25 #include "base/nix/xdg_util.h" | 24 #include "base/nix/xdg_util.h" |
| 26 #elif defined(OS_MACOSX) | 25 #elif defined(OS_MACOSX) |
| 27 #include "base/base_paths_mac.h" | 26 #include "base/base_paths_mac.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 76 |
| 78 virtual void SetFilterProfanities(bool filter_profanities) OVERRIDE { | 77 virtual void SetFilterProfanities(bool filter_profanities) OVERRIDE { |
| 79 } | 78 } |
| 80 | 79 |
| 81 private: | 80 private: |
| 82 DISALLOW_COPY_AND_ASSIGN(ShellSpeechRecognitionPreferences); | 81 DISALLOW_COPY_AND_ASSIGN(ShellSpeechRecognitionPreferences); |
| 83 }; | 82 }; |
| 84 | 83 |
| 85 } // namespace | 84 } // namespace |
| 86 | 85 |
| 87 ShellBrowserContext::ShellBrowserContext( | 86 ShellBrowserContext* ShellBrowserContext::GetInstance() { |
| 88 ShellBrowserMainParts* shell_main_parts) | 87 return Singleton<ShellBrowserContext>::get(); |
| 89 : shell_main_parts_(shell_main_parts) { | 88 } |
| 89 |
| 90 ShellBrowserContext::ShellBrowserContext() { |
| 90 InitWhileIOAllowed(); | 91 InitWhileIOAllowed(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 ShellBrowserContext::~ShellBrowserContext() { | 94 ShellBrowserContext::~ShellBrowserContext() { |
| 94 if (resource_context_.get()) { | 95 if (resource_context_.get()) { |
| 95 BrowserThread::DeleteSoon( | 96 BrowserThread::DeleteSoon( |
| 96 BrowserThread::IO, FROM_HERE, resource_context_.release()); | 97 BrowserThread::IO, FROM_HERE, resource_context_.release()); |
| 97 } | 98 } |
| 98 } | 99 } |
| 99 | 100 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 185 |
| 185 bool ShellBrowserContext::DidLastSessionExitCleanly() { | 186 bool ShellBrowserContext::DidLastSessionExitCleanly() { |
| 186 return true; | 187 return true; |
| 187 } | 188 } |
| 188 | 189 |
| 189 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { | 190 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { |
| 190 return NULL; | 191 return NULL; |
| 191 } | 192 } |
| 192 | 193 |
| 193 } // namespace content | 194 } // namespace content |
| OLD | NEW |