Index: chrome/browser/profiles/profile.h |
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h |
index d38c5abdf1af6974b36953475f3279f9c7948b5b..2c9a8a7a6e8b182943018d5e1a8d6d0d41d3cdc5 100644 |
--- a/chrome/browser/profiles/profile.h |
+++ b/chrome/browser/profiles/profile.h |
@@ -14,6 +14,7 @@ |
#include "base/logging.h" |
#include "chrome/browser/net/preconnect.h" // TODO: remove this. |
#include "chrome/common/extensions/extension.h" |
+#include "content/browser/browser_context.h" |
namespace base { |
class Time; |
@@ -28,10 +29,6 @@ class LibCrosServiceLibraryImpl; |
class ResetDefaultProxyConfigServiceTask; |
} |
-namespace content { |
-class ResourceContext; |
-} |
- |
namespace fileapi { |
class FileSystemContext; |
class SandboxedFileSystemContext; |
@@ -47,31 +44,20 @@ class TransportSecurityState; |
class SSLConfigService; |
} |
- |
namespace prerender { |
class PrerenderManager; |
} |
-namespace quota { |
-class QuotaManager; |
-} |
- |
namespace speech_input { |
class SpeechRecognizer; |
} |
-namespace webkit_database { |
-class DatabaseTracker; |
-} |
- |
class AutocompleteClassifier; |
class BookmarkModel; |
class BrowserSignin; |
class ChromeAppCacheService; |
-class ChromeBlobStorageContext; |
class ChromeURLDataManager; |
class CloudPrintProxyService; |
-class DownloadManager; |
class Extension; |
class ExtensionDevToolsManager; |
class ExtensionEventRouter; |
@@ -82,13 +68,9 @@ class ExtensionProcessManager; |
class ExtensionService; |
class ExtensionSpecialStoragePolicy; |
class FaviconService; |
-class FilePath; |
class FindBarState; |
-class GeolocationContentSettingsMap; |
-class GeolocationPermissionContext; |
class HistoryService; |
class HostContentSettingsMap; |
-class HostZoomMap; |
class NavigationController; |
class PasswordStore; |
class PersonalDataManager; |
@@ -100,7 +82,6 @@ class PromoCounter; |
class ProtocolHandlerRegistry; |
class SQLitePersistentCookieStore; |
class SSLConfigServiceManager; |
-class SSLHostState; |
class SpellCheckHost; |
class TemplateURLFetcher; |
class TokenService; |
@@ -110,13 +91,8 @@ class UserStyleSheetWatcher; |
class VisitedLinkEventListener; |
class VisitedLinkMaster; |
class WebDataService; |
-class WebKitContext; |
class PromoResourceService; |
-namespace net { |
-class URLRequestContextGetter; |
-} |
- |
#if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) |
// Local profile ids are used to associate resources stored outside the profile |
// directory, like saved passwords in GNOME Keyring / KWallet, with a profile. |
@@ -125,7 +101,7 @@ class URLRequestContextGetter; |
typedef int LocalProfileId; |
#endif |
-class Profile { |
+class Profile : public content::BrowserContext { |
public: |
// Profile services are accessed with the following parameter. This parameter |
// defines what the caller plans to do with the service. |
@@ -212,13 +188,34 @@ class Profile { |
static Profile* CreateProfileAsync(const FilePath& path, |
Delegate* delegate); |
+ // Returns the profile corresponding to the given browser context. |
+ static Profile* FromBrowserContext(content::BrowserContext* browser_context); |
+ |
+ // content::BrowserContext implementation ------------------------------------ |
+ |
+ virtual FilePath GetPath() = 0; |
+ virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; |
+ virtual SSLHostState* GetSSLHostState() = 0; |
+ virtual DownloadManager* GetDownloadManager() = 0; |
+ virtual bool HasCreatedDownloadManager() const = 0; |
+ virtual quota::QuotaManager* GetQuotaManager() = 0; |
+ virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
+ virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
+ int renderer_child_id) = 0; |
+ virtual net::URLRequestContextGetter* GetRequestContextForMedia() = 0; |
+ virtual const content::ResourceContext& GetResourceContext() = 0; |
+ virtual HostZoomMap* GetHostZoomMap() = 0; |
+ virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() = 0; |
+ virtual GeolocationPermissionContext* GetGeolocationPermissionContext() = 0; |
+ virtual WebKitContext* GetWebKitContext() = 0; |
+ virtual ChromeBlobStorageContext* GetBlobStorageContext() = 0; |
+ |
+ // content::BrowserContext implementation ------------------------------------ |
+ |
// Returns the name associated with this profile. This name is displayed in |
// the browser frame. |
virtual std::string GetProfileName() = 0; |
- // Returns the path of the directory where this profile's data is stored. |
- virtual FilePath GetPath() = 0; |
- |
// Return whether this profile is incognito. Default is false. |
virtual bool IsOffTheRecord() = 0; |
@@ -240,9 +237,6 @@ class Profile { |
// Returns a pointer to the ChromeAppCacheService instance for this profile. |
virtual ChromeAppCacheService* GetAppCacheService() = 0; |
- // Returns a pointer to the DatabaseTracker instance for this profile. |
- virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; |
- |
// Returns a pointer to the TopSites (thumbnail manager) instance |
// for this profile. |
virtual history::TopSites* GetTopSites() = 0; |
@@ -283,11 +277,6 @@ class Profile { |
virtual ExtensionSpecialStoragePolicy* |
GetExtensionSpecialStoragePolicy() = 0; |
- // Retrieves a pointer to the SSLHostState associated with this profile. |
- // The SSLHostState is lazily created the first time that this method is |
- // called. |
- virtual SSLHostState* GetSSLHostState() = 0; |
- |
// Retrieves a pointer to the TransportSecurityState associated with |
// this profile. The TransportSecurityState is lazily created the |
// first time that this method is called. |
@@ -364,10 +353,6 @@ class Profile { |
// profile. |
virtual TemplateURLFetcher* GetTemplateURLFetcher() = 0; |
- // Returns the DownloadManager associated with this profile. |
- virtual DownloadManager* GetDownloadManager() = 0; |
- virtual bool HasCreatedDownloadManager() const = 0; |
- |
// Returns the PersonalDataManager associated with this profile. |
virtual PersonalDataManager* GetPersonalDataManager() = 0; |
@@ -376,29 +361,9 @@ class Profile { |
// by the profile. |
virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; |
- virtual quota::QuotaManager* GetQuotaManager() = 0; |
- |
// Returns the BrowserSignin object assigned to this profile. |
virtual BrowserSignin* GetBrowserSignin() = 0; |
- // Returns the request context information associated with this profile. Call |
- // this only on the UI thread, since it can send notifications that should |
- // happen on the UI thread. |
- virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
- |
- // Returns the request context appropriate for the given renderer. If the |
- // renderer process doesn't have an assosicated installed app, or if the |
- // installed app's is_storage_isolated() returns false, this is equivalent to |
- // calling GetRequestContext(). |
- // TODO(creis): After isolated app storage is no longer an experimental |
- // feature, consider making this the default contract for GetRequestContext. |
- virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
- int renderer_child_id) = 0; |
- |
- // Returns the request context for media resources asociated with this |
- // profile. |
- virtual net::URLRequestContextGetter* GetRequestContextForMedia() = 0; |
- |
// Returns the request context used for extension-related requests. This |
// is only used for a separate cookie store currently. |
virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; |
@@ -408,8 +373,6 @@ class Profile { |
virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( |
const std::string& app_id) = 0; |
- virtual const content::ResourceContext& GetResourceContext() = 0; |
- |
// Called by the ExtensionService that lives in this profile. Gives the |
// profile a chance to react to the load event before the EXTENSION_LOADED |
// notification has fired. The purpose for handling this event first is to |
@@ -431,15 +394,6 @@ class Profile { |
// Returns the Hostname <-> Content settings map for this profile. |
virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; |
- // Returns the Hostname <-> Zoom Level map for this profile. |
- virtual HostZoomMap* GetHostZoomMap() = 0; |
- |
- // Returns the geolocation settings map for this profile. |
- virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() = 0; |
- |
- // Returns the geolocation permission context for this profile. |
- virtual GeolocationPermissionContext* GetGeolocationPermissionContext() = 0; |
- |
// Returns the user style sheet watcher. |
virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() = 0; |
@@ -493,9 +447,6 @@ class Profile { |
// current spellchecker and replace it with a new one. |
virtual void ReinitializeSpellCheckHost(bool force) = 0; |
- // Returns the WebKitContext assigned to this profile. |
- virtual WebKitContext* GetWebKitContext() = 0; |
- |
// Marks the profile as cleanly shutdown. |
// |
// NOTE: this is invoked internally on a normal shutdown, but is public so |
@@ -518,10 +469,6 @@ class Profile { |
virtual FilePath last_selected_directory() = 0; |
virtual void set_last_selected_directory(const FilePath& path) = 0; |
- // Returns a pointer to the ChromeBlobStorageContext instance for this |
- // profile. |
- virtual ChromeBlobStorageContext* GetBlobStorageContext() = 0; |
- |
// Returns the IO-thread-accessible profile data for this profile. |
virtual ExtensionInfoMap* GetExtensionInfoMap() = 0; |