| 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 // 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 <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/timer.h" | 17 #include "base/timer.h" |
| 18 #include "chrome/browser/prefs/pref_change_registrar.h" | 18 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/profiles/profile_impl_io_data.h" | 20 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 21 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 23 | 23 |
| 24 class ExtensionNavigationObserver; | 24 class ExtensionNavigationObserver; |
| 25 class ExtensionPrefs; | 25 class ExtensionSystem; |
| 26 class ExtensionPrefValueMap; | |
| 27 class NetPrefObserver; | 26 class NetPrefObserver; |
| 28 class PrefService; | 27 class PrefService; |
| 29 class PromoResourceService; | 28 class PromoResourceService; |
| 30 class SSLConfigServiceManager; | 29 class SSLConfigServiceManager; |
| 31 class VisitedLinkEventListener; | 30 class VisitedLinkEventListener; |
| 32 | 31 |
| 33 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
| 34 namespace chromeos { | 33 namespace chromeos { |
| 35 class EnterpriseExtensionObserver; | 34 class EnterpriseExtensionObserver; |
| 36 class LocaleChangeGuard; | 35 class LocaleChangeGuard; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Profile implementation: | 67 // Profile implementation: |
| 69 virtual std::string GetProfileName() OVERRIDE; | 68 virtual std::string GetProfileName() OVERRIDE; |
| 70 virtual bool IsOffTheRecord() const OVERRIDE; | 69 virtual bool IsOffTheRecord() const OVERRIDE; |
| 71 virtual Profile* GetOffTheRecordProfile() OVERRIDE; | 70 virtual Profile* GetOffTheRecordProfile() OVERRIDE; |
| 72 virtual void DestroyOffTheRecordProfile() OVERRIDE; | 71 virtual void DestroyOffTheRecordProfile() OVERRIDE; |
| 73 virtual bool HasOffTheRecordProfile() OVERRIDE; | 72 virtual bool HasOffTheRecordProfile() OVERRIDE; |
| 74 virtual Profile* GetOriginalProfile() OVERRIDE; | 73 virtual Profile* GetOriginalProfile() OVERRIDE; |
| 75 virtual history::TopSites* GetTopSites() OVERRIDE; | 74 virtual history::TopSites* GetTopSites() OVERRIDE; |
| 76 virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; | 75 virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; |
| 77 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE; | 76 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE; |
| 77 virtual ExtensionPrefValueMap* GetExtensionPrefValueMap() OVERRIDE; |
| 78 virtual ExtensionService* GetExtensionService() OVERRIDE; |
| 78 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE; | 79 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE; |
| 79 virtual ExtensionService* GetExtensionService() OVERRIDE; | |
| 80 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() OVERRIDE; | |
| 81 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE; | 80 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE; |
| 82 virtual ExtensionMessageService* GetExtensionMessageService() OVERRIDE; | |
| 83 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE; | 81 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE; |
| 84 virtual ExtensionSpecialStoragePolicy* | 82 virtual ExtensionSpecialStoragePolicy* |
| 85 GetExtensionSpecialStoragePolicy() OVERRIDE; | 83 GetExtensionSpecialStoragePolicy() OVERRIDE; |
| 86 virtual FaviconService* GetFaviconService(ServiceAccessType sat) OVERRIDE; | 84 virtual FaviconService* GetFaviconService(ServiceAccessType sat) OVERRIDE; |
| 87 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; | 85 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; |
| 88 virtual HistoryService* GetHistoryService(ServiceAccessType sat) OVERRIDE; | 86 virtual HistoryService* GetHistoryService(ServiceAccessType sat) OVERRIDE; |
| 89 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE; | 87 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE; |
| 90 virtual AutocompleteClassifier* GetAutocompleteClassifier() OVERRIDE; | 88 virtual AutocompleteClassifier* GetAutocompleteClassifier() OVERRIDE; |
| 91 virtual history::ShortcutsBackend* GetShortcutsBackend() OVERRIDE; | 89 virtual history::ShortcutsBackend* GetShortcutsBackend() OVERRIDE; |
| 92 virtual WebDataService* GetWebDataService(ServiceAccessType sat) OVERRIDE; | 90 virtual WebDataService* GetWebDataService(ServiceAccessType sat) OVERRIDE; |
| 93 virtual WebDataService* GetWebDataServiceWithoutCreating() OVERRIDE; | 91 virtual WebDataService* GetWebDataServiceWithoutCreating() OVERRIDE; |
| 94 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat) OVERRIDE; | 92 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat) OVERRIDE; |
| 95 virtual PrefService* GetPrefs() OVERRIDE; | 93 virtual PrefService* GetPrefs() OVERRIDE; |
| 96 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; | 94 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; |
| 97 virtual TemplateURLFetcher* GetTemplateURLFetcher() OVERRIDE; | 95 virtual TemplateURLFetcher* GetTemplateURLFetcher() OVERRIDE; |
| 98 virtual net::URLRequestContextGetter* | 96 virtual net::URLRequestContextGetter* |
| 99 GetRequestContextForExtensions() OVERRIDE; | 97 GetRequestContextForExtensions() OVERRIDE; |
| 100 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( | 98 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( |
| 101 const std::string& app_id) OVERRIDE; | 99 const std::string& app_id) OVERRIDE; |
| 102 virtual void RegisterExtensionWithRequestContexts( | |
| 103 const Extension* extension) OVERRIDE; | |
| 104 virtual void UnregisterExtensionWithRequestContexts( | |
| 105 const std::string& extension_id, | |
| 106 const extension_misc::UnloadedExtensionReason reason) OVERRIDE; | |
| 107 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE; | 100 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE; |
| 108 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; | 101 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; |
| 109 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() OVERRIDE; | 102 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() OVERRIDE; |
| 110 virtual BookmarkModel* GetBookmarkModel() OVERRIDE; | 103 virtual BookmarkModel* GetBookmarkModel() OVERRIDE; |
| 111 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; | 104 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; |
| 112 virtual bool IsSameProfile(Profile* profile) OVERRIDE; | 105 virtual bool IsSameProfile(Profile* profile) OVERRIDE; |
| 113 virtual base::Time GetStartTime() const OVERRIDE; | 106 virtual base::Time GetStartTime() const OVERRIDE; |
| 114 virtual void MarkAsCleanShutdown() OVERRIDE; | 107 virtual void MarkAsCleanShutdown() OVERRIDE; |
| 115 virtual void InitExtensions(bool extensions_enabled) OVERRIDE; | |
| 116 virtual void InitPromoResources() OVERRIDE; | 108 virtual void InitPromoResources() OVERRIDE; |
| 117 virtual void InitRegisteredProtocolHandlers() OVERRIDE; | 109 virtual void InitRegisteredProtocolHandlers() OVERRIDE; |
| 118 virtual FilePath last_selected_directory() OVERRIDE; | 110 virtual FilePath last_selected_directory() OVERRIDE; |
| 119 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; | 111 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; |
| 120 virtual ExtensionInfoMap* GetExtensionInfoMap() OVERRIDE; | |
| 121 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE; | 112 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE; |
| 122 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; | 113 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; |
| 123 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; | 114 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; |
| 124 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; | 115 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; |
| 125 virtual GURL GetHomePage() OVERRIDE; | 116 virtual GURL GetHomePage() OVERRIDE; |
| 126 | 117 |
| 127 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
| 128 virtual void ChangeAppLocale(const std::string& locale, | 119 virtual void ChangeAppLocale(const std::string& locale, |
| 129 AppLocaleChangedVia) OVERRIDE; | 120 AppLocaleChangedVia) OVERRIDE; |
| 130 virtual void OnLogin() OVERRIDE; | 121 virtual void OnLogin() OVERRIDE; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 void CreatePasswordStore(); | 155 void CreatePasswordStore(); |
| 165 | 156 |
| 166 void StopCreateSessionServiceTimer(); | 157 void StopCreateSessionServiceTimer(); |
| 167 | 158 |
| 168 void EnsureRequestContextCreated() { | 159 void EnsureRequestContextCreated() { |
| 169 GetRequestContext(); | 160 GetRequestContext(); |
| 170 } | 161 } |
| 171 | 162 |
| 172 void EnsureSessionServiceCreated(); | 163 void EnsureSessionServiceCreated(); |
| 173 | 164 |
| 174 ExtensionPrefValueMap* GetExtensionPrefValueMap(); | |
| 175 | |
| 176 void UpdateProfileUserNameCache(); | 165 void UpdateProfileUserNameCache(); |
| 177 | 166 |
| 178 | 167 |
| 179 // Updates the ProfileInfoCache with data from this profile. | 168 // Updates the ProfileInfoCache with data from this profile. |
| 180 void UpdateProfileNameCache(); | 169 void UpdateProfileNameCache(); |
| 181 void UpdateProfileAvatarCache(); | 170 void UpdateProfileAvatarCache(); |
| 182 | 171 |
| 183 void GetCacheParameters(bool is_media_context, | 172 void GetCacheParameters(bool is_media_context, |
| 184 FilePath* cache_path, | 173 FilePath* cache_path, |
| 185 int* max_size); | 174 int* max_size); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 198 | 187 |
| 199 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; | 188 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; |
| 200 // Keep |prefs_| on top for destruction order because |extension_prefs_|, | 189 // Keep |prefs_| on top for destruction order because |extension_prefs_|, |
| 201 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store | 190 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store |
| 202 // pointers to |prefs_| and shall be destructed first. | 191 // pointers to |prefs_| and shall be destructed first. |
| 203 scoped_ptr<PrefService> prefs_; | 192 scoped_ptr<PrefService> prefs_; |
| 204 scoped_ptr<PrefService> otr_prefs_; | 193 scoped_ptr<PrefService> otr_prefs_; |
| 205 scoped_ptr<VisitedLinkEventListener> visited_link_event_listener_; | 194 scoped_ptr<VisitedLinkEventListener> visited_link_event_listener_; |
| 206 scoped_ptr<VisitedLinkMaster> visited_link_master_; | 195 scoped_ptr<VisitedLinkMaster> visited_link_master_; |
| 207 ProfileImplIOData::Handle io_data_; | 196 ProfileImplIOData::Handle io_data_; |
| 208 // Keep extension_prefs_ on top of extension_service_ because the latter | |
| 209 // maintains a pointer to the first and shall be destructed first. | |
| 210 scoped_ptr<ExtensionPrefs> extension_prefs_; | |
| 211 scoped_ptr<ExtensionService> extension_service_; | |
| 212 scoped_refptr<UserScriptMaster> user_script_master_; | |
| 213 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; | |
| 214 // extension_info_map_ needs to outlive extension_process_manager_. | |
| 215 scoped_refptr<ExtensionInfoMap> extension_info_map_; | |
| 216 // |extension_process_manager_| must be destroyed before |io_data_|. | |
| 217 // While |extension_process_manager_| still lives, we handle incoming | |
| 218 // resource requests from extension processes and those require access | |
| 219 // to the ResourceContext owned by |io_data_|. | |
| 220 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | |
| 221 scoped_refptr<ExtensionMessageService> extension_message_service_; | |
| 222 scoped_ptr<ExtensionEventRouter> extension_event_router_; | |
| 223 scoped_ptr<ExtensionNavigationObserver> extension_navigation_observer_; | |
| 224 scoped_refptr<ExtensionSpecialStoragePolicy> | 197 scoped_refptr<ExtensionSpecialStoragePolicy> |
| 225 extension_special_storage_policy_; | 198 extension_special_storage_policy_; |
| 226 scoped_ptr<NetPrefObserver> net_pref_observer_; | 199 scoped_ptr<NetPrefObserver> net_pref_observer_; |
| 227 scoped_ptr<TemplateURLFetcher> template_url_fetcher_; | 200 scoped_ptr<TemplateURLFetcher> template_url_fetcher_; |
| 228 scoped_ptr<BookmarkModel> bookmark_bar_model_; | 201 scoped_ptr<BookmarkModel> bookmark_bar_model_; |
| 229 scoped_refptr<PromoResourceService> promo_resource_service_; | 202 scoped_refptr<PromoResourceService> promo_resource_service_; |
| 230 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_; | 203 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_; |
| 231 | 204 |
| 232 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; | 205 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; |
| 233 | 206 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 Profile::Delegate* delegate_; | 269 Profile::Delegate* delegate_; |
| 297 | 270 |
| 298 chrome_browser_net::Predictor* predictor_; | 271 chrome_browser_net::Predictor* predictor_; |
| 299 | 272 |
| 300 bool session_restore_enabled_; | 273 bool session_restore_enabled_; |
| 301 | 274 |
| 302 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); | 275 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); |
| 303 }; | 276 }; |
| 304 | 277 |
| 305 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 278 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
| OLD | NEW |