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

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

Issue 9959040: Reland 125805 - Reland 124817 - A profile-keyed service for Extensions, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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 LazyBackgroundTaskQueue* GetLazyBackgroundTaskQueue() OVERRIDE;
87 virtual FaviconService* GetFaviconService(ServiceAccessType sat) OVERRIDE; 84 virtual FaviconService* GetFaviconService(ServiceAccessType sat) OVERRIDE;
88 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; 85 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE;
89 virtual HistoryService* GetHistoryService(ServiceAccessType sat) OVERRIDE; 86 virtual HistoryService* GetHistoryService(ServiceAccessType sat) OVERRIDE;
90 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE; 87 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE;
91 virtual AutocompleteClassifier* GetAutocompleteClassifier() OVERRIDE; 88 virtual AutocompleteClassifier* GetAutocompleteClassifier() OVERRIDE;
92 virtual history::ShortcutsBackend* GetShortcutsBackend() OVERRIDE; 89 virtual history::ShortcutsBackend* GetShortcutsBackend() OVERRIDE;
93 virtual WebDataService* GetWebDataService(ServiceAccessType sat) OVERRIDE; 90 virtual WebDataService* GetWebDataService(ServiceAccessType sat) OVERRIDE;
94 virtual WebDataService* GetWebDataServiceWithoutCreating() OVERRIDE; 91 virtual WebDataService* GetWebDataServiceWithoutCreating() OVERRIDE;
95 virtual PrefService* GetPrefs() OVERRIDE; 92 virtual PrefService* GetPrefs() OVERRIDE;
96 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; 93 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE;
97 virtual TemplateURLFetcher* GetTemplateURLFetcher() OVERRIDE; 94 virtual TemplateURLFetcher* GetTemplateURLFetcher() OVERRIDE;
98 virtual net::URLRequestContextGetter* 95 virtual net::URLRequestContextGetter*
99 GetRequestContextForExtensions() OVERRIDE; 96 GetRequestContextForExtensions() OVERRIDE;
100 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( 97 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp(
101 const std::string& app_id) OVERRIDE; 98 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; 99 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE;
108 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; 100 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE;
109 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() OVERRIDE; 101 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() OVERRIDE;
110 virtual BookmarkModel* GetBookmarkModel() OVERRIDE; 102 virtual BookmarkModel* GetBookmarkModel() OVERRIDE;
111 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; 103 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE;
112 virtual bool IsSameProfile(Profile* profile) OVERRIDE; 104 virtual bool IsSameProfile(Profile* profile) OVERRIDE;
113 virtual base::Time GetStartTime() const OVERRIDE; 105 virtual base::Time GetStartTime() const OVERRIDE;
114 virtual void MarkAsCleanShutdown() OVERRIDE; 106 virtual void MarkAsCleanShutdown() OVERRIDE;
115 virtual void InitExtensions(bool extensions_enabled) OVERRIDE;
116 virtual void InitPromoResources() OVERRIDE; 107 virtual void InitPromoResources() OVERRIDE;
117 virtual void InitRegisteredProtocolHandlers() OVERRIDE; 108 virtual void InitRegisteredProtocolHandlers() OVERRIDE;
118 virtual FilePath last_selected_directory() OVERRIDE; 109 virtual FilePath last_selected_directory() OVERRIDE;
119 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; 110 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE;
120 virtual ExtensionInfoMap* GetExtensionInfoMap() OVERRIDE;
121 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE; 111 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE;
122 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; 112 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE;
123 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; 113 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE;
124 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; 114 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE;
125 virtual GURL GetHomePage() OVERRIDE; 115 virtual GURL GetHomePage() OVERRIDE;
126 virtual bool WasCreatedByVersionOrLater(const std::string& version) OVERRIDE; 116 virtual bool WasCreatedByVersionOrLater(const std::string& version) OVERRIDE;
127 117
128 #if defined(OS_CHROMEOS) 118 #if defined(OS_CHROMEOS)
129 virtual void ChangeAppLocale(const std::string& locale, 119 virtual void ChangeAppLocale(const std::string& locale,
130 AppLocaleChangedVia) OVERRIDE; 120 AppLocaleChangedVia) OVERRIDE;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 FilePath GetPrefFilePath(); 157 FilePath GetPrefFilePath();
168 158
169 void StopCreateSessionServiceTimer(); 159 void StopCreateSessionServiceTimer();
170 160
171 void EnsureRequestContextCreated() { 161 void EnsureRequestContextCreated() {
172 GetRequestContext(); 162 GetRequestContext();
173 } 163 }
174 164
175 void EnsureSessionServiceCreated(); 165 void EnsureSessionServiceCreated();
176 166
177 ExtensionPrefValueMap* GetExtensionPrefValueMap();
178
179 void UpdateProfileUserNameCache(); 167 void UpdateProfileUserNameCache();
180 168
181 169
182 // Updates the ProfileInfoCache with data from this profile. 170 // Updates the ProfileInfoCache with data from this profile.
183 void UpdateProfileNameCache(); 171 void UpdateProfileNameCache();
184 void UpdateProfileAvatarCache(); 172 void UpdateProfileAvatarCache();
185 173
186 void GetCacheParameters(bool is_media_context, 174 void GetCacheParameters(bool is_media_context,
187 FilePath* cache_path, 175 FilePath* cache_path,
188 int* max_size); 176 int* max_size);
(...skipping 12 matching lines...) Expand all
201 189
202 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; 190 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_;
203 // Keep |prefs_| on top for destruction order because |extension_prefs_|, 191 // Keep |prefs_| on top for destruction order because |extension_prefs_|,
204 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store 192 // |net_pref_observer_|, |web_resource_service_|, and |io_data_| store
205 // pointers to |prefs_| and shall be destructed first. 193 // pointers to |prefs_| and shall be destructed first.
206 scoped_ptr<PrefService> prefs_; 194 scoped_ptr<PrefService> prefs_;
207 scoped_ptr<PrefService> otr_prefs_; 195 scoped_ptr<PrefService> otr_prefs_;
208 scoped_ptr<VisitedLinkEventListener> visited_link_event_listener_; 196 scoped_ptr<VisitedLinkEventListener> visited_link_event_listener_;
209 scoped_ptr<VisitedLinkMaster> visited_link_master_; 197 scoped_ptr<VisitedLinkMaster> visited_link_master_;
210 ProfileImplIOData::Handle io_data_; 198 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 // This is a dependency of ExtensionMessageService and ExtensionEventRouter.
225 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_;
226 scoped_ptr<ExtensionMessageService> extension_message_service_;
227 scoped_ptr<ExtensionEventRouter> extension_event_router_;
228 scoped_ptr<ExtensionNavigationObserver> extension_navigation_observer_;
229 scoped_refptr<ExtensionSpecialStoragePolicy> 199 scoped_refptr<ExtensionSpecialStoragePolicy>
230 extension_special_storage_policy_; 200 extension_special_storage_policy_;
231 scoped_ptr<NetPrefObserver> net_pref_observer_; 201 scoped_ptr<NetPrefObserver> net_pref_observer_;
232 scoped_ptr<TemplateURLFetcher> template_url_fetcher_; 202 scoped_ptr<TemplateURLFetcher> template_url_fetcher_;
233 scoped_ptr<BookmarkModel> bookmark_bar_model_; 203 scoped_ptr<BookmarkModel> bookmark_bar_model_;
234 scoped_refptr<PromoResourceService> promo_resource_service_; 204 scoped_refptr<PromoResourceService> promo_resource_service_;
235 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_; 205 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_;
236 206
237 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; 207 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_;
238 208
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 Profile::Delegate* delegate_; 270 Profile::Delegate* delegate_;
301 271
302 chrome_browser_net::Predictor* predictor_; 272 chrome_browser_net::Predictor* predictor_;
303 273
304 bool session_restore_enabled_; 274 bool session_restore_enabled_;
305 275
306 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); 276 DISALLOW_COPY_AND_ASSIGN(ProfileImpl);
307 }; 277 };
308 278
309 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ 279 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698