| Index: chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h
|
| diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h
|
| index c1ed746a14a636d502e729331f99b8ac50b84726..5047183f2fad98934f58d4698eea9a769ce07d52 100644
|
| --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h
|
| +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h
|
| @@ -12,8 +12,6 @@
|
| #include "base/memory/singleton.h"
|
| #include "components/browser_context_keyed_service/browser_context_keyed_base_factory.h"
|
|
|
| -class Profile;
|
| -
|
| namespace base {
|
| class SequencedTaskRunner;
|
| }
|
| @@ -33,8 +31,8 @@ class UserCloudPolicyManager;
|
| // UserCloudPolicyManager is handled different than other
|
| // BrowserContextKeyedServices because it is a dependency of PrefService.
|
| // Therefore, lifetime of instances is managed by Profile, Profile startup code
|
| -// invokes CreateForProfile() explicitly, takes ownership, and the instance
|
| -// is only deleted after PrefService destruction.
|
| +// invokes CreateForBrowserContext() explicitly, takes ownership, and the
|
| +// instance is only deleted after PrefService destruction.
|
| //
|
| // TODO(mnissler): Remove the special lifetime management in favor of
|
| // PrefService directly depending on UserCloudPolicyManager once the former has
|
| @@ -45,23 +43,25 @@ class UserCloudPolicyManagerFactory : public BrowserContextKeyedBaseFactory {
|
| // Returns an instance of the UserCloudPolicyManagerFactory singleton.
|
| static UserCloudPolicyManagerFactory* GetInstance();
|
|
|
| - // Returns the UserCloudPolicyManager instance associated with |profile|.
|
| - static UserCloudPolicyManager* GetForProfile(Profile* profile);
|
| + // Returns the UserCloudPolicyManager instance associated with |context|.
|
| + static UserCloudPolicyManager* GetForBrowserContext(
|
| + content::BrowserContext* context);
|
|
|
| - // Creates an instance for |profile|. Note that the caller is responsible for
|
| - // managing the lifetime of the instance. Subsequent calls to GetForProfile()
|
| - // will return the created instance as long as it lives.
|
| + // Creates an instance for |context|. Note that the caller is responsible for
|
| + // managing the lifetime of the instance. Subsequent calls to
|
| + // GetForBrowserContext() will return the created instance as long as it
|
| + // lives.
|
| //
|
| // If |force_immediate_load| is true, policy is loaded synchronously from
|
| // UserCloudPolicyStore at startup.
|
| - static scoped_ptr<UserCloudPolicyManager> CreateForOriginalProfile(
|
| - Profile* profile,
|
| + static scoped_ptr<UserCloudPolicyManager> CreateForOriginalBrowserContext(
|
| + content::BrowserContext* context,
|
| bool force_immediate_load,
|
| scoped_refptr<base::SequencedTaskRunner> background_task_runner);
|
|
|
| - static UserCloudPolicyManager* RegisterForOffTheRecordProfile(
|
| - Profile* original_profile,
|
| - Profile* off_the_record_profile);
|
| + static UserCloudPolicyManager* RegisterForOffTheRecordBrowserContext(
|
| + content::BrowserContext* original_context,
|
| + content::BrowserContext* off_the_record_context);
|
|
|
| private:
|
| friend class UserCloudPolicyManager;
|
| @@ -71,17 +71,17 @@ class UserCloudPolicyManagerFactory : public BrowserContextKeyedBaseFactory {
|
| virtual ~UserCloudPolicyManagerFactory();
|
|
|
| // See comments for the static versions above.
|
| - UserCloudPolicyManager* GetManagerForProfile(
|
| + UserCloudPolicyManager* GetManagerForBrowserContext(
|
| content::BrowserContext* context);
|
|
|
| - scoped_ptr<UserCloudPolicyManager> CreateManagerForOriginalProfile(
|
| - Profile* profile,
|
| + scoped_ptr<UserCloudPolicyManager> CreateManagerForOriginalBrowserContext(
|
| + content::BrowserContext* context,
|
| bool force_immediate_load,
|
| scoped_refptr<base::SequencedTaskRunner> background_task_runner);
|
|
|
| - UserCloudPolicyManager* RegisterManagerForOffTheRecordProfile(
|
| - Profile* original_profile,
|
| - Profile* off_the_record_profile);
|
| + UserCloudPolicyManager* RegisterManagerForOffTheRecordBrowserContext(
|
| + content::BrowserContext* original_context,
|
| + content::BrowserContext* off_the_record_context);
|
|
|
| // BrowserContextKeyedBaseFactory:
|
| virtual void BrowserContextShutdown(
|
|
|