[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ |
| 6 | #define CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ |
| 7 | #pragma once |
| 8 | |
| 9 | #include "base/compiler_specific.h" |
[email protected] | e99ca511 | 2011-09-26 17:22:54 | [diff] [blame] | 10 | #include "base/file_path.h" |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 11 | #include "base/memory/ref_counted.h" |
| 12 | #include "base/memory/scoped_ptr.h" |
[email protected] | ccb79730 | 2011-12-15 16:55:11 | [diff] [blame^] | 13 | #include "content/public/browser/browser_context.h" |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 14 | |
[email protected] | 2909e34 | 2011-10-29 00:46:53 | [diff] [blame] | 15 | class DownloadIdFactory; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 16 | class DownloadManager; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 17 | class DownloadStatusUpdater; |
| 18 | class GeolocationPermissionContext; |
| 19 | class HostZoomMap; |
| 20 | class SSLHostState; |
| 21 | |
| 22 | namespace content { |
| 23 | |
[email protected] | 1bd0ef1 | 2011-10-20 05:24:17 | [diff] [blame] | 24 | class DownloadManagerDelegate; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 25 | class ResourceContext; |
| 26 | class ShellBrowserMainParts; |
[email protected] | 98d6f15 | 2011-09-29 19:35:51 | [diff] [blame] | 27 | class ShellDownloadManagerDelegate; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 28 | |
| 29 | class ShellBrowserContext : public BrowserContext { |
| 30 | public: |
| 31 | explicit ShellBrowserContext(ShellBrowserMainParts* shell_main_parts); |
| 32 | virtual ~ShellBrowserContext(); |
| 33 | |
| 34 | // BrowserContext implementation. |
| 35 | virtual FilePath GetPath() OVERRIDE; |
| 36 | virtual bool IsOffTheRecord() OVERRIDE; |
| 37 | virtual SSLHostState* GetSSLHostState() OVERRIDE; |
| 38 | virtual DownloadManager* GetDownloadManager() OVERRIDE; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 39 | virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
| 40 | virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
| 41 | int renderer_child_id) OVERRIDE; |
| 42 | virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; |
| 43 | virtual const ResourceContext& GetResourceContext() OVERRIDE; |
| 44 | virtual HostZoomMap* GetHostZoomMap() OVERRIDE; |
| 45 | virtual GeolocationPermissionContext* |
| 46 | GetGeolocationPermissionContext() OVERRIDE; |
[email protected] | 8238dd6 | 2011-09-29 15:13:01 | [diff] [blame] | 47 | virtual SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 48 | virtual bool DidLastSessionExitCleanly() OVERRIDE; |
| 49 | virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; |
| 50 | virtual WebKitContext* GetWebKitContext() OVERRIDE; |
| 51 | virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; |
| 52 | virtual ChromeBlobStorageContext* GetBlobStorageContext() OVERRIDE; |
| 53 | virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE; |
| 54 | virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE; |
| 55 | |
| 56 | private: |
| 57 | void CreateQuotaManagerAndClients(); |
| 58 | |
[email protected] | e99ca511 | 2011-09-26 17:22:54 | [diff] [blame] | 59 | FilePath path_; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 60 | scoped_ptr<ResourceContext> resource_context_; |
| 61 | scoped_ptr<SSLHostState> ssl_host_state_; |
| 62 | scoped_ptr<DownloadStatusUpdater> download_status_updater_; |
[email protected] | 98d6f15 | 2011-09-29 19:35:51 | [diff] [blame] | 63 | scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_; |
[email protected] | 2909e34 | 2011-10-29 00:46:53 | [diff] [blame] | 64 | scoped_refptr<DownloadIdFactory> download_id_factory_; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 65 | scoped_refptr<DownloadManager> download_manager_; |
| 66 | scoped_refptr<net::URLRequestContextGetter> url_request_getter_; |
| 67 | scoped_refptr<HostZoomMap> host_zoom_map_; |
| 68 | scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; |
[email protected] | 8238dd6 | 2011-09-29 15:13:01 | [diff] [blame] | 69 | scoped_refptr<SpeechInputPreferences> speech_input_preferences_; |
[email protected] | b0f146f | 2011-09-15 22:14:25 | [diff] [blame] | 70 | scoped_refptr<WebKitContext> webkit_context_; |
| 71 | scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 72 | scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
| 73 | scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
| 74 | scoped_refptr<quota::QuotaManager> quota_manager_; |
| 75 | scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 76 | |
| 77 | ShellBrowserMainParts* shell_main_parts_; |
| 78 | |
| 79 | DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); |
| 80 | }; |
| 81 | |
| 82 | } // namespace content |
| 83 | |
| 84 | #endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ |