| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 // This class gathers state related to a single user profile. | 5 // This class gathers state related to a single user profile. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
| 8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/timer.h" | 14 #include "base/timer.h" |
| 15 #include "chrome/browser/prefs/pref_change_registrar.h" | 15 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_impl_io_data.h" | 17 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 18 #include "content/common/notification_observer.h" | 18 #include "content/common/notification_observer.h" |
| 19 #include "content/common/notification_registrar.h" | 19 #include "content/common/notification_registrar.h" |
| 20 | 20 |
| 21 class ChromeDownloadManagerDelegate; | |
| 22 class ExtensionNavigationObserver; | 21 class ExtensionNavigationObserver; |
| 23 class ExtensionPrefs; | 22 class ExtensionPrefs; |
| 24 class ExtensionPrefValueMap; | 23 class ExtensionPrefValueMap; |
| 25 class ExtensionSettings; | 24 class ExtensionSettings; |
| 26 class NetPrefObserver; | 25 class NetPrefObserver; |
| 27 class PrefService; | 26 class PrefService; |
| 28 class SpeechInputPreferences; | 27 class SpeechInputPreferences; |
| 29 class SpellCheckProfile; | 28 class SpellCheckProfile; |
| 30 | 29 |
| 31 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
| 32 namespace chromeos { | 31 namespace chromeos { |
| 33 class EnterpriseExtensionObserver; | 32 class EnterpriseExtensionObserver; |
| 34 class LocaleChangeGuard; | 33 class LocaleChangeGuard; |
| 35 class Preferences; | 34 class Preferences; |
| 36 } | 35 } |
| 37 #endif | 36 #endif |
| 38 | 37 |
| 39 // The default profile implementation. | 38 // The default profile implementation. |
| 40 class ProfileImpl : public Profile, | 39 class ProfileImpl : public Profile, |
| 41 public NotificationObserver { | 40 public NotificationObserver { |
| 42 public: | 41 public: |
| 43 virtual ~ProfileImpl(); | 42 virtual ~ProfileImpl(); |
| 44 | 43 |
| 45 static void RegisterUserPrefs(PrefService* prefs); | 44 static void RegisterUserPrefs(PrefService* prefs); |
| 46 | 45 |
| 47 // content::BrowserContext implementation: | 46 // content::BrowserContext implementation: |
| 48 virtual FilePath GetPath() OVERRIDE; | 47 virtual FilePath GetPath() OVERRIDE; |
| 49 virtual SSLHostState* GetSSLHostState() OVERRIDE; | 48 virtual SSLHostState* GetSSLHostState() OVERRIDE; |
| 50 virtual DownloadManager* GetDownloadManager() OVERRIDE; | 49 virtual DownloadManager* GetDownloadManager() OVERRIDE; |
| 51 virtual bool HasCreatedDownloadManager() const OVERRIDE; | |
| 52 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 50 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
| 53 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 51 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
| 54 int renderer_child_id) OVERRIDE; | 52 int renderer_child_id) OVERRIDE; |
| 55 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; | 53 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; |
| 56 virtual const content::ResourceContext& GetResourceContext() OVERRIDE; | 54 virtual const content::ResourceContext& GetResourceContext() OVERRIDE; |
| 57 virtual HostZoomMap* GetHostZoomMap() OVERRIDE; | 55 virtual HostZoomMap* GetHostZoomMap() OVERRIDE; |
| 58 virtual GeolocationPermissionContext* | 56 virtual GeolocationPermissionContext* |
| 59 GetGeolocationPermissionContext() OVERRIDE; | 57 GetGeolocationPermissionContext() OVERRIDE; |
| 60 virtual SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; | 58 virtual SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; |
| 61 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; | 59 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void EnsureSessionServiceCreated(); | 175 void EnsureSessionServiceCreated(); |
| 178 | 176 |
| 179 void RegisterComponentExtensions(); | 177 void RegisterComponentExtensions(); |
| 180 | 178 |
| 181 ExtensionPrefValueMap* GetExtensionPrefValueMap(); | 179 ExtensionPrefValueMap* GetExtensionPrefValueMap(); |
| 182 | 180 |
| 183 void CreateQuotaManagerAndClients(); | 181 void CreateQuotaManagerAndClients(); |
| 184 | 182 |
| 185 SpellCheckProfile* GetSpellCheckProfile(); | 183 SpellCheckProfile* GetSpellCheckProfile(); |
| 186 | 184 |
| 187 virtual void SetDownloadManagerDelegate( | |
| 188 ChromeDownloadManagerDelegate* delegate); | |
| 189 | |
| 190 NotificationRegistrar registrar_; | 185 NotificationRegistrar registrar_; |
| 191 PrefChangeRegistrar pref_change_registrar_; | 186 PrefChangeRegistrar pref_change_registrar_; |
| 192 | 187 |
| 193 FilePath path_; | 188 FilePath path_; |
| 194 FilePath base_cache_path_; | 189 FilePath base_cache_path_; |
| 195 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; | 190 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; |
| 196 // Keep |prefs_| on top for destruction order because |extension_prefs_|, | 191 // Keep |prefs_| on top for destruction order because |extension_prefs_|, |
| 197 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store | 192 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store |
| 198 // pointers to |prefs_| and shall be destructed first. | 193 // pointers to |prefs_| and shall be destructed first. |
| 199 scoped_ptr<PrefService> prefs_; | 194 scoped_ptr<PrefService> prefs_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 227 | 222 |
| 228 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; | 223 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; |
| 229 | 224 |
| 230 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 225 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 231 scoped_refptr<HostZoomMap> host_zoom_map_; | 226 scoped_refptr<HostZoomMap> host_zoom_map_; |
| 232 scoped_refptr<GeolocationPermissionContext> | 227 scoped_refptr<GeolocationPermissionContext> |
| 233 geolocation_permission_context_; | 228 geolocation_permission_context_; |
| 234 scoped_refptr<SpeechInputPreferences> speech_input_preferences_; | 229 scoped_refptr<SpeechInputPreferences> speech_input_preferences_; |
| 235 scoped_refptr<UserStyleSheetWatcher> user_style_sheet_watcher_; | 230 scoped_refptr<UserStyleSheetWatcher> user_style_sheet_watcher_; |
| 236 scoped_ptr<FindBarState> find_bar_state_; | 231 scoped_ptr<FindBarState> find_bar_state_; |
| 237 scoped_refptr<ChromeDownloadManagerDelegate> download_manager_delegate_; | |
| 238 scoped_refptr<DownloadManager> download_manager_; | |
| 239 scoped_refptr<HistoryService> history_service_; | 232 scoped_refptr<HistoryService> history_service_; |
| 240 scoped_ptr<FaviconService> favicon_service_; | 233 scoped_ptr<FaviconService> favicon_service_; |
| 241 scoped_ptr<AutocompleteClassifier> autocomplete_classifier_; | 234 scoped_ptr<AutocompleteClassifier> autocomplete_classifier_; |
| 242 scoped_refptr<history::ShortcutsBackend> shortcuts_backend_; | 235 scoped_refptr<history::ShortcutsBackend> shortcuts_backend_; |
| 243 scoped_refptr<WebDataService> web_data_service_; | 236 scoped_refptr<WebDataService> web_data_service_; |
| 244 scoped_refptr<PasswordStore> password_store_; | 237 scoped_refptr<PasswordStore> password_store_; |
| 245 scoped_refptr<WebKitContext> webkit_context_; | 238 scoped_refptr<WebKitContext> webkit_context_; |
| 246 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 239 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
| 247 scoped_refptr<quota::QuotaManager> quota_manager_; | 240 scoped_refptr<quota::QuotaManager> quota_manager_; |
| 248 bool history_service_created_; | 241 bool history_service_created_; |
| 249 bool favicon_service_created_; | 242 bool favicon_service_created_; |
| 250 bool created_web_data_service_; | 243 bool created_web_data_service_; |
| 251 bool created_password_store_; | 244 bool created_password_store_; |
| 252 bool created_download_manager_; | |
| 253 bool clear_local_state_on_exit_; | 245 bool clear_local_state_on_exit_; |
| 254 // Whether or not the last session exited cleanly. This is set only once. | 246 // Whether or not the last session exited cleanly. This is set only once. |
| 255 bool last_session_exited_cleanly_; | 247 bool last_session_exited_cleanly_; |
| 256 | 248 |
| 257 base::OneShotTimer<ProfileImpl> create_session_service_timer_; | 249 base::OneShotTimer<ProfileImpl> create_session_service_timer_; |
| 258 | 250 |
| 259 scoped_ptr<Profile> off_the_record_profile_; | 251 scoped_ptr<Profile> off_the_record_profile_; |
| 260 | 252 |
| 261 // See GetStartTime for details. | 253 // See GetStartTime for details. |
| 262 base::Time start_time_; | 254 base::Time start_time_; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; | 288 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; |
| 297 | 289 |
| 298 Profile::Delegate* delegate_; | 290 Profile::Delegate* delegate_; |
| 299 | 291 |
| 300 chrome_browser_net::Predictor* predictor_; | 292 chrome_browser_net::Predictor* predictor_; |
| 301 | 293 |
| 302 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); | 294 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); |
| 303 }; | 295 }; |
| 304 | 296 |
| 305 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 297 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
| OLD | NEW |