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

Side by Side Diff: chrome/browser/profiles/profile.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
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_H_ 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_
8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_
9 #pragma once 9 #pragma once
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/hash_tables.h" 14 #include "base/hash_tables.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "chrome/browser/net/preconnect.h" // TODO: remove this. 16 #include "chrome/browser/net/preconnect.h" // TODO: remove this.
17 #include "chrome/browser/net/pref_proxy_config_tracker.h" 17 #include "chrome/browser/net/pref_proxy_config_tracker.h"
18 #include "chrome/common/extensions/extension_constants.h"
19 #include "content/public/browser/browser_context.h" 18 #include "content/public/browser/browser_context.h"
20 19
21 class AutocompleteClassifier; 20 class AutocompleteClassifier;
22 class BookmarkModel; 21 class BookmarkModel;
23 class ChromeAppCacheService; 22 class ChromeAppCacheService;
24 class ChromeURLDataManager; 23 class ChromeURLDataManager;
25 class Extension; 24 class Extension;
26 class ExtensionDevToolsManager;
27 class ExtensionEventRouter; 25 class ExtensionEventRouter;
28 class ExtensionInfoMap; 26 class ExtensionPrefValueMap;
29 class ExtensionMessageService;
30 class ExtensionProcessManager; 27 class ExtensionProcessManager;
31 class ExtensionService; 28 class ExtensionService;
32 class ExtensionSpecialStoragePolicy; 29 class ExtensionSpecialStoragePolicy;
33 class FaviconService; 30 class FaviconService;
34 class GAIAInfoUpdateService; 31 class GAIAInfoUpdateService;
35 class HistoryService; 32 class HistoryService;
36 class HostContentSettingsMap; 33 class HostContentSettingsMap;
37 class LazyBackgroundTaskQueue;
38 class PasswordStore; 34 class PasswordStore;
39 class PrefService; 35 class PrefService;
40 class PromoCounter; 36 class PromoCounter;
41 class ProtocolHandlerRegistry; 37 class ProtocolHandlerRegistry;
42 class TemplateURLFetcher; 38 class TemplateURLFetcher;
43 class TestingProfile; 39 class TestingProfile;
44 class UserScriptMaster; 40 class UserScriptMaster;
45 class UserStyleSheetWatcher; 41 class UserStyleSheetWatcher;
46 class VisitedLinkMaster; 42 class VisitedLinkMaster;
47 class WebDataService; 43 class WebDataService;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 virtual history::TopSites* GetTopSites() = 0; 201 virtual history::TopSites* GetTopSites() = 0;
206 202
207 // Variant of GetTopSites that doesn't force creation. 203 // Variant of GetTopSites that doesn't force creation.
208 virtual history::TopSites* GetTopSitesWithoutCreating() = 0; 204 virtual history::TopSites* GetTopSitesWithoutCreating() = 0;
209 205
210 // Retrieves a pointer to the VisitedLinkMaster associated with this 206 // Retrieves a pointer to the VisitedLinkMaster associated with this
211 // profile. The VisitedLinkMaster is lazily created the first time 207 // profile. The VisitedLinkMaster is lazily created the first time
212 // that this method is called. 208 // that this method is called.
213 virtual VisitedLinkMaster* GetVisitedLinkMaster() = 0; 209 virtual VisitedLinkMaster* GetVisitedLinkMaster() = 0;
214 210
211 // Accessor. The instance is created upon first access.
212 // TODO(yoz): make this a ProfileKeyedService.
213 virtual ExtensionPrefValueMap* GetExtensionPrefValueMap() = 0;
214
215 // DEPRECATED. Instead, use ExtensionSystemFactory::extension_service().
215 // Retrieves a pointer to the ExtensionService associated with this 216 // Retrieves a pointer to the ExtensionService associated with this
216 // profile. The ExtensionService is created at startup. 217 // profile. The ExtensionService is created at startup.
218 // TODO(yoz): remove this accessor (bug 104095).
217 virtual ExtensionService* GetExtensionService() = 0; 219 virtual ExtensionService* GetExtensionService() = 0;
218 220
221 // DEPRECATED. Instead, use ExtensionSystemFactory::user_script_master().
219 // Retrieves a pointer to the UserScriptMaster associated with this 222 // Retrieves a pointer to the UserScriptMaster associated with this
220 // profile. The UserScriptMaster is lazily created the first time 223 // profile. The UserScriptMaster is lazily created the first time
221 // that this method is called. 224 // that this method is called.
225 // TODO(yoz): remove this accessor (bug 104095).
222 virtual UserScriptMaster* GetUserScriptMaster() = 0; 226 virtual UserScriptMaster* GetUserScriptMaster() = 0;
223 227
224 // Retrieves a pointer to the ExtensionDevToolsManager associated with this 228 // DEPRECATED. Instead, use ExtensionSystemFactory::process_manager().
225 // profile. The instance is created at startup.
226 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() = 0;
227
228 // Retrieves a pointer to the ExtensionProcessManager associated with this 229 // Retrieves a pointer to the ExtensionProcessManager associated with this
229 // profile. The instance is created at startup. 230 // profile. The instance is created at startup.
231 // TODO(yoz): remove this accessor (bug 104095).
230 virtual ExtensionProcessManager* GetExtensionProcessManager() = 0; 232 virtual ExtensionProcessManager* GetExtensionProcessManager() = 0;
231 233
232 // Retrieves a pointer to the ExtensionMessageService associated with this 234 // DEPRECATED. Instead, use ExtensionSystemFactory::event_router().
233 // profile. The instance is created at startup.
234 virtual ExtensionMessageService* GetExtensionMessageService() = 0;
235
236 // Accessor. The instance is created at startup. 235 // Accessor. The instance is created at startup.
236 // TODO(yoz): remove this accessor (bug 104095).
237 virtual ExtensionEventRouter* GetExtensionEventRouter() = 0; 237 virtual ExtensionEventRouter* GetExtensionEventRouter() = 0;
238 238
239 // Accessor. The instance is created upon first access. 239 // Accessor. The instance is created upon first access.
240 virtual ExtensionSpecialStoragePolicy* 240 virtual ExtensionSpecialStoragePolicy*
241 GetExtensionSpecialStoragePolicy() = 0; 241 GetExtensionSpecialStoragePolicy() = 0;
242 242
243 // Accessor. The instance is created at startup.
244 // TODO(yoz): this belongs with the ExtensionSystem.
245 virtual LazyBackgroundTaskQueue* GetLazyBackgroundTaskQueue() = 0;
246
247 // Retrieves a pointer to the FaviconService associated with this 243 // Retrieves a pointer to the FaviconService associated with this
248 // profile. The FaviconService is lazily created the first time 244 // profile. The FaviconService is lazily created the first time
249 // that this method is called. 245 // that this method is called.
250 // 246 //
251 // Although FaviconService is refcounted, this will not addref, and callers 247 // Although FaviconService is refcounted, this will not addref, and callers
252 // do not need to do any reference counting as long as they keep the pointer 248 // do not need to do any reference counting as long as they keep the pointer
253 // only for the local scope (which they should do anyway since the browser 249 // only for the local scope (which they should do anyway since the browser
254 // process may decide to shut down). 250 // process may decide to shut down).
255 // 251 //
256 // |access| defines what the caller plans to do with the service. See 252 // |access| defines what the caller plans to do with the service. See
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 311
316 // Returns the request context used for extension-related requests. This 312 // Returns the request context used for extension-related requests. This
317 // is only used for a separate cookie store currently. 313 // is only used for a separate cookie store currently.
318 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; 314 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0;
319 315
320 // Returns the request context used within an installed app that has 316 // Returns the request context used within an installed app that has
321 // requested isolated storage. 317 // requested isolated storage.
322 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( 318 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp(
323 const std::string& app_id) = 0; 319 const std::string& app_id) = 0;
324 320
325 // Called by the ExtensionService that lives in this profile. Gives the
326 // profile a chance to react to the load event before the EXTENSION_LOADED
327 // notification has fired. The purpose for handling this event first is to
328 // avoid race conditions by making sure URLRequestContexts learn about new
329 // extensions before anything else needs them to know.
330 virtual void RegisterExtensionWithRequestContexts(
331 const Extension* extension) {}
332
333 // Called by the ExtensionService that lives in this profile. Lets the
334 // profile clean up its RequestContexts once all the listeners to the
335 // EXTENSION_UNLOADED notification have finished running.
336 virtual void UnregisterExtensionWithRequestContexts(
337 const std::string& extension_id,
338 const extension_misc::UnloadedExtensionReason) {}
339
340 // Returns the SSLConfigService for this profile. 321 // Returns the SSLConfigService for this profile.
341 virtual net::SSLConfigService* GetSSLConfigService() = 0; 322 virtual net::SSLConfigService* GetSSLConfigService() = 0;
342 323
343 // Returns the Hostname <-> Content settings map for this profile. 324 // Returns the Hostname <-> Content settings map for this profile.
344 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; 325 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0;
345 326
346 // Returns the user style sheet watcher. 327 // Returns the user style sheet watcher.
347 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() = 0; 328 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() = 0;
348 329
349 // Returns the BookmarkModel, creating if not yet created. 330 // Returns the BookmarkModel, creating if not yet created.
(...skipping 13 matching lines...) Expand all
363 // this profile. For the single profile case, this corresponds to the time 344 // this profile. For the single profile case, this corresponds to the time
364 // the user started chrome. 345 // the user started chrome.
365 virtual base::Time GetStartTime() const = 0; 346 virtual base::Time GetStartTime() const = 0;
366 347
367 // Marks the profile as cleanly shutdown. 348 // Marks the profile as cleanly shutdown.
368 // 349 //
369 // NOTE: this is invoked internally on a normal shutdown, but is public so 350 // NOTE: this is invoked internally on a normal shutdown, but is public so
370 // that it can be invoked when the user logs out/powers down (WM_ENDSESSION). 351 // that it can be invoked when the user logs out/powers down (WM_ENDSESSION).
371 virtual void MarkAsCleanShutdown() = 0; 352 virtual void MarkAsCleanShutdown() = 0;
372 353
373 // Initializes extensions machinery.
374 // Component extensions are always enabled, external and user extensions
375 // are controlled by |extensions_enabled|.
376 virtual void InitExtensions(bool extensions_enabled) = 0;
377
378 // Start up service that gathers data from a promo resource feed. 354 // Start up service that gathers data from a promo resource feed.
379 virtual void InitPromoResources() = 0; 355 virtual void InitPromoResources() = 0;
380 356
381 // Register URLRequestFactories for protocols registered with 357 // Register URLRequestFactories for protocols registered with
382 // registerProtocolHandler. 358 // registerProtocolHandler.
383 virtual void InitRegisteredProtocolHandlers() = 0; 359 virtual void InitRegisteredProtocolHandlers() = 0;
384 360
385 // Returns the last directory that was chosen for uploading or opening a file. 361 // Returns the last directory that was chosen for uploading or opening a file.
386 virtual FilePath last_selected_directory() = 0; 362 virtual FilePath last_selected_directory() = 0;
387 virtual void set_last_selected_directory(const FilePath& path) = 0; 363 virtual void set_last_selected_directory(const FilePath& path) = 0;
388 364
389 // Returns the IO-thread-accessible profile data for this profile.
390 virtual ExtensionInfoMap* GetExtensionInfoMap() = 0;
391
392 // Returns the PromoCounter for Instant, or NULL if not applicable. 365 // Returns the PromoCounter for Instant, or NULL if not applicable.
393 virtual PromoCounter* GetInstantPromoCounter() = 0; 366 virtual PromoCounter* GetInstantPromoCounter() = 0;
394 367
395 // Returns the ChromeURLDataManager for this profile. 368 // Returns the ChromeURLDataManager for this profile.
396 virtual ChromeURLDataManager* GetChromeURLDataManager() = 0; 369 virtual ChromeURLDataManager* GetChromeURLDataManager() = 0;
397 370
398 #if defined(OS_CHROMEOS) 371 #if defined(OS_CHROMEOS)
399 enum AppLocaleChangedVia { 372 enum AppLocaleChangedVia {
400 // Caused by chrome://settings change. 373 // Caused by chrome://settings change.
401 APP_LOCALE_CHANGED_VIA_SETTINGS, 374 APP_LOCALE_CHANGED_VIA_SETTINGS,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 struct hash<Profile*> { 488 struct hash<Profile*> {
516 std::size_t operator()(Profile* const& p) const { 489 std::size_t operator()(Profile* const& p) const {
517 return reinterpret_cast<std::size_t>(p); 490 return reinterpret_cast<std::size_t>(p);
518 } 491 }
519 }; 492 };
520 493
521 } // namespace BASE_HASH_NAMESPACE 494 } // namespace BASE_HASH_NAMESPACE
522 #endif 495 #endif
523 496
524 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ 497 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl_unittest.cc ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698