#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
+#include "components/domain_reliability/clear_mode.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
-#include "net/url_request/url_request_job_factory.h"
class ChromeAppCacheService;
-class ExtensionService;
+class DevToolsNetworkController;
class ExtensionSpecialStoragePolicy;
class FaviconService;
class HostContentSettingsMap;
-class PasswordStore;
class PrefProxyConfigTracker;
class PrefService;
class PromoCounter;
class ProtocolHandlerRegistry;
class TestingProfile;
-class WebDataService;
namespace android {
class TabContentsProvider;
class Time;
}
+namespace chrome {
+class ChromeZoomLevelPrefs;
+}
+
namespace chrome_browser_net {
class Predictor;
}
class WebUI;
}
-namespace fileapi {
+namespace storage {
class FileSystemContext;
}
namespace history {
-class ShortcutsBackend;
class TopSites;
}
}
// Instead of adding more members to Profile, consider creating a
-// BrowserContextKeyedService. See
+// KeyedService. See
// http://dev.chromium.org/developers/design-documents/profile-architecture
class Profile : public content::BrowserContext {
public:
CREATE_STATUS_CREATED,
// Profile is created, extensions and promo resources are initialized.
CREATE_STATUS_INITIALIZED,
- // Profile creation (managed-user registration, generally) was canceled
+ // Profile creation (supervised-user registration, generally) was canceled
// by the user.
CREATE_STATUS_CANCELED,
MAX_CREATE_STATUS // For histogram display.
EXIT_CRASHED,
};
+ enum ProfileType {
+ REGULAR_PROFILE, // Login user's normal profile
+ INCOGNITO_PROFILE, // Login user's off-the-record profile
+ GUEST_PROFILE, // Guest session's profile
+ };
+
class Delegate {
public:
virtual ~Delegate();
// Key used to bind profile to the widget with which it is associated.
static const char kProfileKey[];
+ // Value representing no hosted domain in the kProfileHostedDomain preference.
+ static const char kNoHostedDomainFound[];
Profile();
- virtual ~Profile();
+ ~Profile() override;
// Profile prefs are registered as soon as the prefs are loaded for the first
// time.
// the browser frame.
virtual std::string GetProfileName() = 0;
+ // Returns the profile type.
+ virtual ProfileType GetProfileType() const = 0;
+
// Return the incognito version of this profile. The returned pointer
// is owned by the receiving profile. If the receiving profile is off the
// record, the same profile is returned.
// profile is not incognito.
virtual Profile* GetOriginalProfile() = 0;
- // Returns whether the profile is managed (see ManagedUserService).
- virtual bool IsManaged() = 0;
+ // Returns whether the profile is supervised (see SupervisedUserService).
+ virtual bool IsSupervised() = 0;
// Returns a pointer to the TopSites (thumbnail manager) instance
// for this profile.
// Variant of GetTopSites that doesn't force creation.
virtual history::TopSites* GetTopSitesWithoutCreating() = 0;
- // DEPRECATED. Instead, use ExtensionSystem::extension_service().
- // Retrieves a pointer to the ExtensionService associated with this
- // profile. The ExtensionService is created at startup.
- // TODO(yoz): remove this accessor (bug 104095).
- virtual ExtensionService* GetExtensionService() = 0;
-
// Accessor. The instance is created upon first access.
virtual ExtensionSpecialStoragePolicy*
GetExtensionSpecialStoragePolicy() = 0;
// preferences for this user profile.
virtual PrefService* GetPrefs() = 0;
+ // Retrieves a pointer to the PrefService that manages the default zoom
+ // level and the per-host zoom levels for this user profile.
+ // TODO(wjmaclean): Remove this when HostZoomMap migrates to StoragePartition.
+ virtual chrome::ChromeZoomLevelPrefs* GetZoomLevelPrefs();
+
// Retrieves a pointer to the PrefService that manages the preferences
// for OffTheRecord Profiles. This PrefService is lazily created the first
// time that this method is called.
virtual PrefService* GetOffTheRecordPrefs() = 0;
// Returns the main request context.
- virtual net::URLRequestContextGetter* GetRequestContext() = 0;
+ virtual net::URLRequestContextGetter* GetRequestContext() override = 0;
// Returns the request context used for extension-related requests. This
// is only used for a separate cookie store currently.
// ContextBrowserClient to call this function.
// TODO(ajwong): Remove once http://crbug.com/159193 is resolved.
virtual net::URLRequestContextGetter* CreateRequestContext(
- content::ProtocolHandlerMap* protocol_handlers) = 0;
+ content::ProtocolHandlerMap* protocol_handlers,
+ content::URLRequestInterceptorScopedVector request_interceptors) = 0;
// Creates the net::URLRequestContextGetter for a StoragePartition. Should
// only be called once per partition_path per ContentBrowserClient object.
virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory,
- content::ProtocolHandlerMap* protocol_handlers) = 0;
+ content::ProtocolHandlerMap* protocol_handlers,
+ content::URLRequestInterceptorScopedVector request_interceptors) = 0;
// Returns the last directory that was chosen for uploading or opening a file.
virtual base::FilePath last_selected_directory() = 0;
APP_LOCALE_CHANGED_VIA_REVERT,
// From login screen.
APP_LOCALE_CHANGED_VIA_LOGIN,
+ // From login to a public session.
+ APP_LOCALE_CHANGED_VIA_PUBLIC_SESSION_LOGIN,
// Source unknown.
APP_LOCALE_CHANGED_VIA_UNKNOWN
};
// Returns the Predictor object used for dns prefetch.
virtual chrome_browser_net::Predictor* GetNetworkPredictor() = 0;
+ // Returns the DevToolsNetworkController for this profile.
+ virtual DevToolsNetworkController* GetDevToolsNetworkController() = 0;
+
// Deletes all network related data since |time|. It deletes transport
// security state since |time| and it also deletes HttpServerProperties data.
// Works asynchronously, however if the |completion| callback is non-null, it
DISALLOW_COPY_AND_ASSIGN(Profile);
};
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-
-template<>
-struct hash<Profile*> {
- std::size_t operator()(Profile* const& p) const {
- return reinterpret_cast<std::size_t>(p);
- }
+// The comparator for profile pointers as key in a map.
+struct ProfileCompare {
+ bool operator()(Profile* a, Profile* b) const;
};
-} // namespace BASE_HASH_NAMESPACE
-#endif
-
#endif // CHROME_BROWSER_PROFILES_PROFILE_H_