| 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 #ifndef CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ |
| 6 #define CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ | 6 #define CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class OffTheRecordProfileImpl : public Profile, | 28 class OffTheRecordProfileImpl : public Profile, |
| 29 public BrowserList::Observer, | 29 public BrowserList::Observer, |
| 30 public content::NotificationObserver { | 30 public content::NotificationObserver { |
| 31 public: | 31 public: |
| 32 explicit OffTheRecordProfileImpl(Profile* real_profile); | 32 explicit OffTheRecordProfileImpl(Profile* real_profile); |
| 33 virtual ~OffTheRecordProfileImpl(); | 33 virtual ~OffTheRecordProfileImpl(); |
| 34 void Init(); | 34 void Init(); |
| 35 | 35 |
| 36 // Profile implementation. | 36 // Profile implementation. |
| 37 virtual std::string GetProfileName() OVERRIDE; | 37 virtual std::string GetProfileName() OVERRIDE; |
| 38 virtual FilePath GetPath() OVERRIDE; | |
| 39 virtual bool IsOffTheRecord() OVERRIDE; | |
| 40 virtual Profile* GetOffTheRecordProfile() OVERRIDE; | 38 virtual Profile* GetOffTheRecordProfile() OVERRIDE; |
| 41 virtual void DestroyOffTheRecordProfile() OVERRIDE; | 39 virtual void DestroyOffTheRecordProfile() OVERRIDE; |
| 42 virtual bool HasOffTheRecordProfile() OVERRIDE; | 40 virtual bool HasOffTheRecordProfile() OVERRIDE; |
| 43 virtual Profile* GetOriginalProfile() OVERRIDE; | 41 virtual Profile* GetOriginalProfile() OVERRIDE; |
| 44 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE; | |
| 45 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; | |
| 46 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE; | 42 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE; |
| 47 virtual ExtensionService* GetExtensionService() OVERRIDE; | 43 virtual ExtensionService* GetExtensionService() OVERRIDE; |
| 48 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE; | 44 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE; |
| 49 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() OVERRIDE; | 45 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() OVERRIDE; |
| 50 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE; | 46 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE; |
| 51 virtual ExtensionMessageService* GetExtensionMessageService() OVERRIDE; | 47 virtual ExtensionMessageService* GetExtensionMessageService() OVERRIDE; |
| 52 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE; | 48 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE; |
| 53 virtual ExtensionSpecialStoragePolicy* | 49 virtual ExtensionSpecialStoragePolicy* |
| 54 GetExtensionSpecialStoragePolicy() OVERRIDE; | 50 GetExtensionSpecialStoragePolicy() OVERRIDE; |
| 55 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; | 51 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; |
| 56 virtual HistoryService* GetHistoryService(ServiceAccessType sat) OVERRIDE; | 52 virtual HistoryService* GetHistoryService(ServiceAccessType sat) OVERRIDE; |
| 57 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE; | 53 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE; |
| 58 virtual FaviconService* GetFaviconService(ServiceAccessType sat) OVERRIDE; | 54 virtual FaviconService* GetFaviconService(ServiceAccessType sat) OVERRIDE; |
| 59 virtual AutocompleteClassifier* GetAutocompleteClassifier() OVERRIDE; | 55 virtual AutocompleteClassifier* GetAutocompleteClassifier() OVERRIDE; |
| 60 virtual history::ShortcutsBackend* GetShortcutsBackend() OVERRIDE; | 56 virtual history::ShortcutsBackend* GetShortcutsBackend() OVERRIDE; |
| 61 virtual WebDataService* GetWebDataService(ServiceAccessType sat) OVERRIDE; | 57 virtual WebDataService* GetWebDataService(ServiceAccessType sat) OVERRIDE; |
| 62 virtual WebDataService* GetWebDataServiceWithoutCreating() OVERRIDE; | 58 virtual WebDataService* GetWebDataServiceWithoutCreating() OVERRIDE; |
| 63 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat) OVERRIDE; | 59 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat) OVERRIDE; |
| 64 virtual PrefService* GetPrefs() OVERRIDE; | 60 virtual PrefService* GetPrefs() OVERRIDE; |
| 65 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; | 61 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; |
| 66 virtual TemplateURLFetcher* GetTemplateURLFetcher() OVERRIDE; | 62 virtual TemplateURLFetcher* GetTemplateURLFetcher() OVERRIDE; |
| 67 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; | |
| 68 virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE; | |
| 69 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | |
| 70 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; | |
| 71 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | |
| 72 int renderer_child_id) OVERRIDE; | |
| 73 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; | |
| 74 virtual net::URLRequestContextGetter* | 63 virtual net::URLRequestContextGetter* |
| 75 GetRequestContextForExtensions() OVERRIDE; | 64 GetRequestContextForExtensions() OVERRIDE; |
| 76 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( | 65 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( |
| 77 const std::string& app_id) OVERRIDE; | 66 const std::string& app_id) OVERRIDE; |
| 78 virtual content::ResourceContext* GetResourceContext() OVERRIDE; | |
| 79 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE; | 67 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE; |
| 80 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; | 68 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; |
| 81 virtual content::HostZoomMap* GetHostZoomMap() OVERRIDE; | |
| 82 virtual content::GeolocationPermissionContext* | |
| 83 GetGeolocationPermissionContext() OVERRIDE; | |
| 84 virtual content::SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; | |
| 85 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() OVERRIDE; | 69 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() OVERRIDE; |
| 86 virtual bool DidLastSessionExitCleanly() OVERRIDE; | |
| 87 virtual BookmarkModel* GetBookmarkModel() OVERRIDE; | 70 virtual BookmarkModel* GetBookmarkModel() OVERRIDE; |
| 88 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; | 71 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; |
| 89 virtual TokenService* GetTokenService() OVERRIDE; | 72 virtual TokenService* GetTokenService() OVERRIDE; |
| 90 virtual bool IsSameProfile(Profile* profile) OVERRIDE; | 73 virtual bool IsSameProfile(Profile* profile) OVERRIDE; |
| 91 virtual Time GetStartTime() const OVERRIDE; | 74 virtual Time GetStartTime() const OVERRIDE; |
| 92 virtual WebKitContext* GetWebKitContext() OVERRIDE; | |
| 93 virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; | 75 virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; |
| 94 virtual history::TopSites* GetTopSites() OVERRIDE; | 76 virtual history::TopSites* GetTopSites() OVERRIDE; |
| 95 virtual void MarkAsCleanShutdown() OVERRIDE; | 77 virtual void MarkAsCleanShutdown() OVERRIDE; |
| 96 virtual void InitExtensions(bool extensions_enabled) OVERRIDE; | 78 virtual void InitExtensions(bool extensions_enabled) OVERRIDE; |
| 97 virtual void InitPromoResources() OVERRIDE; | 79 virtual void InitPromoResources() OVERRIDE; |
| 98 virtual void InitRegisteredProtocolHandlers() OVERRIDE; | 80 virtual void InitRegisteredProtocolHandlers() OVERRIDE; |
| 99 virtual FilePath last_selected_directory() OVERRIDE; | 81 virtual FilePath last_selected_directory() OVERRIDE; |
| 100 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; | 82 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; |
| 101 | 83 |
| 102 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
| 103 virtual void SetupChromeOSEnterpriseExtensionObserver() OVERRIDE; | 85 virtual void SetupChromeOSEnterpriseExtensionObserver() OVERRIDE; |
| 104 virtual void InitChromeOSPreferences() OVERRIDE; | 86 virtual void InitChromeOSPreferences() OVERRIDE; |
| 105 #endif // defined(OS_CHROMEOS) | 87 #endif // defined(OS_CHROMEOS) |
| 106 | 88 |
| 107 virtual void OnBrowserAdded(const Browser* browser) OVERRIDE; | 89 virtual void OnBrowserAdded(const Browser* browser) OVERRIDE; |
| 108 virtual void OnBrowserRemoved(const Browser* browser) OVERRIDE; | 90 virtual void OnBrowserRemoved(const Browser* browser) OVERRIDE; |
| 109 virtual ChromeBlobStorageContext* GetBlobStorageContext() OVERRIDE; | |
| 110 virtual ExtensionInfoMap* GetExtensionInfoMap() OVERRIDE; | 91 virtual ExtensionInfoMap* GetExtensionInfoMap() OVERRIDE; |
| 111 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; | 92 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; |
| 112 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE; | 93 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE; |
| 113 | 94 |
| 114 #if defined(OS_CHROMEOS) | 95 #if defined(OS_CHROMEOS) |
| 115 virtual void ChangeAppLocale(const std::string& locale, | 96 virtual void ChangeAppLocale(const std::string& locale, |
| 116 AppLocaleChangedVia) OVERRIDE; | 97 AppLocaleChangedVia) OVERRIDE; |
| 117 virtual void OnLogin() OVERRIDE; | 98 virtual void OnLogin() OVERRIDE; |
| 118 #endif // defined(OS_CHROMEOS) | 99 #endif // defined(OS_CHROMEOS) |
| 119 | 100 |
| 120 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; | 101 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; |
| 121 | 102 |
| 122 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; | 103 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; |
| 123 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; | 104 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; |
| 124 virtual GURL GetHomePage() OVERRIDE; | 105 virtual GURL GetHomePage() OVERRIDE; |
| 125 | 106 |
| 107 // content::BrowserContext implementation: |
| 108 virtual FilePath GetPath() OVERRIDE; |
| 109 virtual bool IsOffTheRecord() OVERRIDE; |
| 110 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; |
| 111 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
| 112 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
| 113 int renderer_child_id) OVERRIDE; |
| 114 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; |
| 115 virtual content::ResourceContext* GetResourceContext() OVERRIDE; |
| 116 virtual content::HostZoomMap* GetHostZoomMap() OVERRIDE; |
| 117 virtual content::GeolocationPermissionContext* |
| 118 GetGeolocationPermissionContext() OVERRIDE; |
| 119 virtual content::SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; |
| 120 virtual bool DidLastSessionExitCleanly() OVERRIDE; |
| 121 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
| 122 |
| 126 // content::NotificationObserver implementation. | 123 // content::NotificationObserver implementation. |
| 127 virtual void Observe(int type, | 124 virtual void Observe(int type, |
| 128 const content::NotificationSource& source, | 125 const content::NotificationSource& source, |
| 129 const content::NotificationDetails& details) OVERRIDE; | 126 const content::NotificationDetails& details) OVERRIDE; |
| 130 | 127 |
| 131 private: | 128 private: |
| 132 void CreateQuotaManagerAndClients(); | |
| 133 | |
| 134 content::NotificationRegistrar registrar_; | 129 content::NotificationRegistrar registrar_; |
| 135 | 130 |
| 136 // The real underlying profile. | 131 // The real underlying profile. |
| 137 Profile* profile_; | 132 Profile* profile_; |
| 138 | 133 |
| 139 // Weak pointer owned by |profile_|. | 134 // Weak pointer owned by |profile_|. |
| 140 PrefService* prefs_; | 135 PrefService* prefs_; |
| 141 | 136 |
| 142 OffTheRecordProfileIOData::Handle io_data_; | 137 OffTheRecordProfileIOData::Handle io_data_; |
| 143 | 138 |
| 144 // Must be freed before |io_data_|. While |extension_process_manager_| still | 139 // Must be freed before |io_data_|. While |extension_process_manager_| still |
| 145 // lives, we handle incoming resource requests from extension processes and | 140 // lives, we handle incoming resource requests from extension processes and |
| 146 // those require access to the ResourceContext owned by |io_data_|. | 141 // those require access to the ResourceContext owned by |io_data_|. |
| 147 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 142 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
| 148 | 143 |
| 149 // We use a non-persistent content settings map for OTR. | 144 // We use a non-persistent content settings map for OTR. |
| 150 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 145 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 151 | 146 |
| 152 // Use a separate zoom map for OTR. | 147 // Use a separate zoom map for OTR. |
| 153 scoped_refptr<content::HostZoomMap> host_zoom_map_; | 148 scoped_refptr<content::HostZoomMap> host_zoom_map_; |
| 154 | 149 |
| 155 // Use a special WebKit context for OTR browsing. | |
| 156 scoped_refptr<WebKitContext> webkit_context_; | |
| 157 | |
| 158 // Time we were started. | 150 // Time we were started. |
| 159 Time start_time_; | 151 Time start_time_; |
| 160 | 152 |
| 161 scoped_refptr<ChromeAppCacheService> appcache_service_; | |
| 162 | |
| 163 // The main database tracker for this profile. | |
| 164 // Should be used only on the file thread. | |
| 165 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; | |
| 166 | |
| 167 FilePath last_selected_directory_; | 153 FilePath last_selected_directory_; |
| 168 | 154 |
| 169 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | |
| 170 | |
| 171 // The file_system context for this profile. | |
| 172 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | |
| 173 | |
| 174 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 155 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
| 175 | 156 |
| 176 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; | 157 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; |
| 177 | 158 |
| 178 scoped_refptr<quota::QuotaManager> quota_manager_; | |
| 179 | |
| 180 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); | 159 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); |
| 181 }; | 160 }; |
| 182 | 161 |
| 183 #endif // CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ | 162 #endif // CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ |
| OLD | NEW |