OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PROFILE_IMPL_H_ | 7 #ifndef CHROME_BROWSER_PROFILE_IMPL_H_ |
8 #define CHROME_BROWSER_PROFILE_IMPL_H_ | 8 #define CHROME_BROWSER_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/ref_counted.h" | 12 #include "base/ref_counted.h" |
13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
14 #include "base/timer.h" | 14 #include "base/timer.h" |
15 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profile.h" |
16 #include "chrome/browser/prefs/pref_change_registrar.h" | 16 #include "chrome/browser/prefs/pref_change_registrar.h" |
17 #include "chrome/browser/spellcheck_host_observer.h" | 17 #include "chrome/browser/spellcheck_host_observer.h" |
18 #include "chrome/common/notification_observer.h" | 18 #include "chrome/common/notification_observer.h" |
19 #include "chrome/common/notification_registrar.h" | 19 #include "chrome/common/notification_registrar.h" |
20 | 20 |
21 class ExtensionPrefs; | |
21 class PrefService; | 22 class PrefService; |
23 class PrefStore; | |
22 | 24 |
23 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
24 namespace chromeos { | 26 namespace chromeos { |
25 class Preferences; | 27 class Preferences; |
26 } | 28 } |
27 #endif | 29 #endif |
28 | 30 |
29 class NetPrefObserver; | 31 class NetPrefObserver; |
30 | 32 |
31 // The default profile implementation. | 33 // The default profile implementation. |
(...skipping 27 matching lines...) Expand all Loading... | |
59 virtual ExtensionMessageService* GetExtensionMessageService(); | 61 virtual ExtensionMessageService* GetExtensionMessageService(); |
60 virtual ExtensionEventRouter* GetExtensionEventRouter(); | 62 virtual ExtensionEventRouter* GetExtensionEventRouter(); |
61 virtual FaviconService* GetFaviconService(ServiceAccessType sat); | 63 virtual FaviconService* GetFaviconService(ServiceAccessType sat); |
62 virtual HistoryService* GetHistoryService(ServiceAccessType sat); | 64 virtual HistoryService* GetHistoryService(ServiceAccessType sat); |
63 virtual HistoryService* GetHistoryServiceWithoutCreating(); | 65 virtual HistoryService* GetHistoryServiceWithoutCreating(); |
64 virtual AutocompleteClassifier* GetAutocompleteClassifier(); | 66 virtual AutocompleteClassifier* GetAutocompleteClassifier(); |
65 virtual WebDataService* GetWebDataService(ServiceAccessType sat); | 67 virtual WebDataService* GetWebDataService(ServiceAccessType sat); |
66 virtual WebDataService* GetWebDataServiceWithoutCreating(); | 68 virtual WebDataService* GetWebDataServiceWithoutCreating(); |
67 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat); | 69 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat); |
68 virtual PrefService* GetPrefs(); | 70 virtual PrefService* GetPrefs(); |
71 virtual PrefStore* GetExtensionPrefStore(); | |
72 virtual void SetExtensionPrefStore(PrefStore* extension_pref_store); | |
69 virtual TemplateURLModel* GetTemplateURLModel(); | 73 virtual TemplateURLModel* GetTemplateURLModel(); |
70 virtual TemplateURLFetcher* GetTemplateURLFetcher(); | 74 virtual TemplateURLFetcher* GetTemplateURLFetcher(); |
71 virtual DownloadManager* GetDownloadManager(); | 75 virtual DownloadManager* GetDownloadManager(); |
72 virtual PersonalDataManager* GetPersonalDataManager(); | 76 virtual PersonalDataManager* GetPersonalDataManager(); |
73 virtual BrowserFileSystemContext* GetFileSystemContext(); | 77 virtual BrowserFileSystemContext* GetFileSystemContext(); |
74 virtual void InitThemes(); | 78 virtual void InitThemes(); |
75 virtual void SetTheme(const Extension* extension); | 79 virtual void SetTheme(const Extension* extension); |
76 virtual void SetNativeTheme(); | 80 virtual void SetNativeTheme(); |
77 virtual void ClearTheme(); | 81 virtual void ClearTheme(); |
78 virtual const Extension* GetTheme(); | 82 virtual const Extension* GetTheme(); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 } | 165 } |
162 | 166 |
163 void RegisterComponentExtensions(); | 167 void RegisterComponentExtensions(); |
164 void InstallDefaultApps(); | 168 void InstallDefaultApps(); |
165 | 169 |
166 NotificationRegistrar registrar_; | 170 NotificationRegistrar registrar_; |
167 PrefChangeRegistrar pref_change_registrar_; | 171 PrefChangeRegistrar pref_change_registrar_; |
168 | 172 |
169 FilePath path_; | 173 FilePath path_; |
170 FilePath base_cache_path_; | 174 FilePath base_cache_path_; |
175 scoped_ptr<PrefService> prefs_; // Keep this on top for destruction order | |
Aaron Boodman
2010/12/03 08:58:10
Scary comment is scary. What is causing the destru
battre (please use the other)
2010/12/03 19:32:58
Well, this is just playing save. The situation has
Aaron Boodman
2010/12/03 20:00:44
Sorry, I still don't understand. Can you clarify w
battre (please use the other)
2010/12/06 10:28:50
Maybe this comment is clearer:
// Keep prefs_ on
Aaron Boodman
2010/12/06 18:20:56
I talked to a few people in this office about this
Mattias Nissler (ping if slow)
2010/12/06 19:29:50
I agree that relying on implicit destruction order
| |
176 // because many other class members depend | |
177 // on it. | |
171 scoped_ptr<VisitedLinkEventListener> visited_link_event_listener_; | 178 scoped_ptr<VisitedLinkEventListener> visited_link_event_listener_; |
172 scoped_ptr<VisitedLinkMaster> visited_link_master_; | 179 scoped_ptr<VisitedLinkMaster> visited_link_master_; |
180 scoped_ptr<ExtensionPrefs> extension_prefs_; | |
173 scoped_refptr<ExtensionsService> extensions_service_; | 181 scoped_refptr<ExtensionsService> extensions_service_; |
174 scoped_refptr<UserScriptMaster> user_script_master_; | 182 scoped_refptr<UserScriptMaster> user_script_master_; |
175 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; | 183 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; |
176 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 184 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
177 scoped_refptr<ExtensionMessageService> extension_message_service_; | 185 scoped_refptr<ExtensionMessageService> extension_message_service_; |
178 scoped_ptr<ExtensionEventRouter> extension_event_router_; | 186 scoped_ptr<ExtensionEventRouter> extension_event_router_; |
179 scoped_ptr<SSLHostState> ssl_host_state_; | 187 scoped_ptr<SSLHostState> ssl_host_state_; |
180 scoped_refptr<net::TransportSecurityState> | 188 scoped_refptr<net::TransportSecurityState> |
181 transport_security_state_; | 189 transport_security_state_; |
182 scoped_refptr<TransportSecurityPersister> | 190 scoped_refptr<TransportSecurityPersister> |
183 transport_security_persister_; | 191 transport_security_persister_; |
184 scoped_ptr<policy::ProfilePolicyContext> profile_policy_context_; | 192 scoped_ptr<policy::ProfilePolicyContext> profile_policy_context_; |
185 scoped_ptr<PrefService> prefs_; | |
186 scoped_ptr<NetPrefObserver> net_pref_observer_; | 193 scoped_ptr<NetPrefObserver> net_pref_observer_; |
187 scoped_ptr<TemplateURLFetcher> template_url_fetcher_; | 194 scoped_ptr<TemplateURLFetcher> template_url_fetcher_; |
188 scoped_ptr<TemplateURLModel> template_url_model_; | 195 scoped_ptr<TemplateURLModel> template_url_model_; |
189 scoped_ptr<BookmarkModel> bookmark_bar_model_; | 196 scoped_ptr<BookmarkModel> bookmark_bar_model_; |
190 scoped_refptr<WebResourceService> web_resource_service_; | 197 scoped_refptr<WebResourceService> web_resource_service_; |
191 scoped_ptr<NTPResourceCache> ntp_resource_cache_; | 198 scoped_ptr<NTPResourceCache> ntp_resource_cache_; |
192 | 199 |
193 scoped_ptr<TokenService> token_service_; | 200 scoped_ptr<TokenService> token_service_; |
194 scoped_ptr<ProfileSyncFactory> profile_sync_factory_; | 201 scoped_ptr<ProfileSyncFactory> profile_sync_factory_; |
195 scoped_ptr<ProfileSyncService> sync_service_; | 202 scoped_ptr<ProfileSyncService> sync_service_; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 // The main database tracker for this profile. | 276 // The main database tracker for this profile. |
270 // Should be used only on the file thread. | 277 // Should be used only on the file thread. |
271 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; | 278 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
272 | 279 |
273 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. | 280 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. |
274 | 281 |
275 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 282 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
276 | 283 |
277 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 284 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
278 | 285 |
286 // weak pointer to ExtensionPrefStore that stores effective extension | |
287 // controlled preferences. | |
288 PrefStore* extension_pref_store_; | |
289 | |
279 #if defined(OS_CHROMEOS) | 290 #if defined(OS_CHROMEOS) |
280 scoped_ptr<chromeos::Preferences> chromeos_preferences_; | 291 scoped_ptr<chromeos::Preferences> chromeos_preferences_; |
281 | 292 |
282 scoped_refptr<chromeos::ProxyConfigServiceImpl> | 293 scoped_refptr<chromeos::ProxyConfigServiceImpl> |
283 chromeos_proxy_config_service_impl_; | 294 chromeos_proxy_config_service_impl_; |
284 #endif | 295 #endif |
285 | 296 |
286 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 297 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
287 | 298 |
288 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); | 299 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); |
289 }; | 300 }; |
290 | 301 |
291 #endif // CHROME_BROWSER_PROFILE_IMPL_H_ | 302 #endif // CHROME_BROWSER_PROFILE_IMPL_H_ |
OLD | NEW |