Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: chrome/browser/profiles/profile_impl.h

Issue 9369013: Take extensions out of Profile into a profile-keyed service, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/timer.h" 16 #include "base/timer.h"
17 #include "chrome/browser/prefs/pref_change_registrar.h" 17 #include "chrome/browser/prefs/pref_change_registrar.h"
18 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/profiles/profile_impl_io_data.h" 19 #include "chrome/browser/profiles/profile_impl_io_data.h"
20 #include "content/public/browser/notification_observer.h" 20 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/notification_registrar.h" 21 #include "content/public/browser/notification_registrar.h"
22 22
23 class ExtensionNavigationObserver; 23 class ExtensionNavigationObserver;
24 class ExtensionPrefs;
25 class ExtensionPrefValueMap; 24 class ExtensionPrefValueMap;
25 class ExtensionSystem;
26 class NetPrefObserver; 26 class NetPrefObserver;
27 class PrefService; 27 class PrefService;
28 class PromoResourceService; 28 class PromoResourceService;
29 class SpeechInputPreferences; 29 class SpeechInputPreferences;
30 class SSLConfigServiceManager; 30 class SSLConfigServiceManager;
31 class VisitedLinkEventListener; 31 class VisitedLinkEventListener;
32 32
33 #if defined(OS_CHROMEOS) 33 #if defined(OS_CHROMEOS)
34 namespace chromeos { 34 namespace chromeos {
35 class EnterpriseExtensionObserver; 35 class EnterpriseExtensionObserver;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // Profile implementation: 69 // Profile implementation:
70 virtual std::string GetProfileName() OVERRIDE; 70 virtual std::string GetProfileName() OVERRIDE;
71 virtual bool IsOffTheRecord() OVERRIDE; 71 virtual bool IsOffTheRecord() OVERRIDE;
72 virtual Profile* GetOffTheRecordProfile() OVERRIDE; 72 virtual Profile* GetOffTheRecordProfile() OVERRIDE;
73 virtual void DestroyOffTheRecordProfile() OVERRIDE; 73 virtual void DestroyOffTheRecordProfile() OVERRIDE;
74 virtual bool HasOffTheRecordProfile() OVERRIDE; 74 virtual bool HasOffTheRecordProfile() OVERRIDE;
75 virtual Profile* GetOriginalProfile() OVERRIDE; 75 virtual Profile* GetOriginalProfile() OVERRIDE;
76 virtual history::TopSites* GetTopSites() OVERRIDE; 76 virtual history::TopSites* GetTopSites() OVERRIDE;
77 virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; 77 virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE;
78 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE; 78 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE;
79 virtual ExtensionService* GetExtensionService() OVERRIDE;
79 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE; 80 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE;
80 virtual ExtensionService* GetExtensionService() OVERRIDE;
81 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() OVERRIDE;
82 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE; 81 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE;
83 virtual ExtensionMessageService* GetExtensionMessageService() OVERRIDE;
84 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE; 82 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE;
85 virtual ExtensionSpecialStoragePolicy* 83 virtual ExtensionSpecialStoragePolicy*
86 GetExtensionSpecialStoragePolicy() OVERRIDE; 84 GetExtensionSpecialStoragePolicy() OVERRIDE;
87 virtual FaviconService* GetFaviconService(ServiceAccessType sat) OVERRIDE; 85 virtual FaviconService* GetFaviconService(ServiceAccessType sat) OVERRIDE;
88 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; 86 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE;
89 virtual HistoryService* GetHistoryService(ServiceAccessType sat) OVERRIDE; 87 virtual HistoryService* GetHistoryService(ServiceAccessType sat) OVERRIDE;
90 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE; 88 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE;
91 virtual AutocompleteClassifier* GetAutocompleteClassifier() OVERRIDE; 89 virtual AutocompleteClassifier* GetAutocompleteClassifier() OVERRIDE;
92 virtual history::ShortcutsBackend* GetShortcutsBackend() OVERRIDE; 90 virtual history::ShortcutsBackend* GetShortcutsBackend() OVERRIDE;
93 virtual WebDataService* GetWebDataService(ServiceAccessType sat) OVERRIDE; 91 virtual WebDataService* GetWebDataService(ServiceAccessType sat) OVERRIDE;
94 virtual WebDataService* GetWebDataServiceWithoutCreating() OVERRIDE; 92 virtual WebDataService* GetWebDataServiceWithoutCreating() OVERRIDE;
95 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat) OVERRIDE; 93 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat) OVERRIDE;
96 virtual PrefService* GetPrefs() OVERRIDE; 94 virtual PrefService* GetPrefs() OVERRIDE;
97 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; 95 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE;
98 virtual TemplateURLFetcher* GetTemplateURLFetcher() OVERRIDE; 96 virtual TemplateURLFetcher* GetTemplateURLFetcher() OVERRIDE;
99 virtual net::URLRequestContextGetter* 97 virtual net::URLRequestContextGetter*
100 GetRequestContextForExtensions() OVERRIDE; 98 GetRequestContextForExtensions() OVERRIDE;
101 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( 99 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp(
102 const std::string& app_id) OVERRIDE; 100 const std::string& app_id) OVERRIDE;
103 virtual void RegisterExtensionWithRequestContexts(
104 const Extension* extension) OVERRIDE;
105 virtual void UnregisterExtensionWithRequestContexts(
106 const std::string& extension_id,
107 const extension_misc::UnloadedExtensionReason reason) OVERRIDE;
108 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE; 101 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE;
109 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; 102 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE;
110 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() OVERRIDE; 103 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() OVERRIDE;
111 virtual bool DidLastSessionExitCleanly() OVERRIDE; 104 virtual bool DidLastSessionExitCleanly() OVERRIDE;
112 virtual BookmarkModel* GetBookmarkModel() OVERRIDE; 105 virtual BookmarkModel* GetBookmarkModel() OVERRIDE;
113 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; 106 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE;
114 virtual bool IsSameProfile(Profile* profile) OVERRIDE; 107 virtual bool IsSameProfile(Profile* profile) OVERRIDE;
115 virtual base::Time GetStartTime() const OVERRIDE; 108 virtual base::Time GetStartTime() const OVERRIDE;
116 virtual void MarkAsCleanShutdown() OVERRIDE; 109 virtual void MarkAsCleanShutdown() OVERRIDE;
117 virtual void InitExtensions(bool extensions_enabled) OVERRIDE;
118 virtual void InitPromoResources() OVERRIDE; 110 virtual void InitPromoResources() OVERRIDE;
119 virtual void InitRegisteredProtocolHandlers() OVERRIDE; 111 virtual void InitRegisteredProtocolHandlers() OVERRIDE;
120 virtual FilePath last_selected_directory() OVERRIDE; 112 virtual FilePath last_selected_directory() OVERRIDE;
121 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; 113 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE;
122 virtual TokenService* GetTokenService() OVERRIDE; 114 virtual TokenService* GetTokenService() OVERRIDE;
123 virtual ExtensionInfoMap* GetExtensionInfoMap() OVERRIDE;
124 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE; 115 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE;
125 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; 116 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE;
126 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; 117 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE;
127 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; 118 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE;
128 virtual GURL GetHomePage() OVERRIDE; 119 virtual GURL GetHomePage() OVERRIDE;
129 virtual void SaveSessionState() OVERRIDE; 120 virtual void SaveSessionState() OVERRIDE;
130 121
131 #if defined(OS_CHROMEOS) 122 #if defined(OS_CHROMEOS)
132 virtual void ChangeAppLocale(const std::string& locale, 123 virtual void ChangeAppLocale(const std::string& locale,
133 AppLocaleChangedVia) OVERRIDE; 124 AppLocaleChangedVia) OVERRIDE;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 192
202 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; 193 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_;
203 // Keep |prefs_| on top for destruction order because |extension_prefs_|, 194 // Keep |prefs_| on top for destruction order because |extension_prefs_|,
204 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store 195 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store
205 // pointers to |prefs_| and shall be destructed first. 196 // pointers to |prefs_| and shall be destructed first.
206 scoped_ptr<PrefService> prefs_; 197 scoped_ptr<PrefService> prefs_;
207 scoped_ptr<PrefService> otr_prefs_; 198 scoped_ptr<PrefService> otr_prefs_;
208 scoped_ptr<VisitedLinkEventListener> visited_link_event_listener_; 199 scoped_ptr<VisitedLinkEventListener> visited_link_event_listener_;
209 scoped_ptr<VisitedLinkMaster> visited_link_master_; 200 scoped_ptr<VisitedLinkMaster> visited_link_master_;
210 ProfileImplIOData::Handle io_data_; 201 ProfileImplIOData::Handle io_data_;
211 // Keep extension_prefs_ on top of extension_service_ because the latter
212 // maintains a pointer to the first and shall be destructed first.
213 scoped_ptr<ExtensionPrefs> extension_prefs_;
214 scoped_ptr<ExtensionService> extension_service_;
215 scoped_refptr<UserScriptMaster> user_script_master_;
216 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_;
217 // extension_info_map_ needs to outlive extension_process_manager_.
218 scoped_refptr<ExtensionInfoMap> extension_info_map_;
219 // |extension_process_manager_| must be destroyed before |io_data_|.
220 // While |extension_process_manager_| still lives, we handle incoming
221 // resource requests from extension processes and those require access
222 // to the ResourceContext owned by |io_data_|.
223 scoped_ptr<ExtensionProcessManager> extension_process_manager_;
224 scoped_refptr<ExtensionMessageService> extension_message_service_;
225 scoped_ptr<ExtensionEventRouter> extension_event_router_;
226 scoped_ptr<ExtensionNavigationObserver> extension_navigation_observer_;
227 scoped_refptr<ExtensionSpecialStoragePolicy> 202 scoped_refptr<ExtensionSpecialStoragePolicy>
228 extension_special_storage_policy_; 203 extension_special_storage_policy_;
229 scoped_ptr<SSLHostState> ssl_host_state_; 204 scoped_ptr<SSLHostState> ssl_host_state_;
230 scoped_ptr<NetPrefObserver> net_pref_observer_; 205 scoped_ptr<NetPrefObserver> net_pref_observer_;
231 scoped_ptr<TemplateURLFetcher> template_url_fetcher_; 206 scoped_ptr<TemplateURLFetcher> template_url_fetcher_;
232 scoped_ptr<BookmarkModel> bookmark_bar_model_; 207 scoped_ptr<BookmarkModel> bookmark_bar_model_;
233 scoped_refptr<PromoResourceService> promo_resource_service_; 208 scoped_refptr<PromoResourceService> promo_resource_service_;
234 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_; 209 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_;
235 210
236 scoped_ptr<TokenService> token_service_; 211 scoped_ptr<TokenService> token_service_;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 Profile::Delegate* delegate_; 290 Profile::Delegate* delegate_;
316 291
317 chrome_browser_net::Predictor* predictor_; 292 chrome_browser_net::Predictor* predictor_;
318 293
319 bool session_restore_enabled_; 294 bool session_restore_enabled_;
320 295
321 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); 296 DISALLOW_COPY_AND_ASSIGN(ProfileImpl);
322 }; 297 };
323 298
324 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ 299 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698