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 ec9c2515b3de9ae0cb049c75c7a129533a35a702..c1ed746a14a636d502e729331f99b8ac50b84726 100644 |
--- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h |
+++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h |
@@ -18,6 +18,10 @@ namespace base { |
class SequencedTaskRunner; |
} |
+namespace content { |
+class BrowserContext; |
+} |
+ |
namespace policy { |
class UserCloudPolicyManager; |
@@ -50,11 +54,15 @@ class UserCloudPolicyManagerFactory : public BrowserContextKeyedBaseFactory { |
// |
// If |force_immediate_load| is true, policy is loaded synchronously from |
// UserCloudPolicyStore at startup. |
- static scoped_ptr<UserCloudPolicyManager> CreateForProfile( |
+ static scoped_ptr<UserCloudPolicyManager> CreateForOriginalProfile( |
Profile* profile, |
bool force_immediate_load, |
scoped_refptr<base::SequencedTaskRunner> background_task_runner); |
+ static UserCloudPolicyManager* RegisterForOffTheRecordProfile( |
+ Profile* original_profile, |
+ Profile* off_the_record_profile); |
+ |
private: |
friend class UserCloudPolicyManager; |
friend struct DefaultSingletonTraits<UserCloudPolicyManagerFactory>; |
@@ -63,24 +71,34 @@ class UserCloudPolicyManagerFactory : public BrowserContextKeyedBaseFactory { |
virtual ~UserCloudPolicyManagerFactory(); |
// See comments for the static versions above. |
- UserCloudPolicyManager* GetManagerForProfile(Profile* profile); |
- scoped_ptr<UserCloudPolicyManager> CreateManagerForProfile( |
+ UserCloudPolicyManager* GetManagerForProfile( |
+ content::BrowserContext* context); |
+ |
+ scoped_ptr<UserCloudPolicyManager> CreateManagerForOriginalProfile( |
Profile* profile, |
bool force_immediate_load, |
scoped_refptr<base::SequencedTaskRunner> background_task_runner); |
+ UserCloudPolicyManager* RegisterManagerForOffTheRecordProfile( |
+ Profile* original_profile, |
+ Profile* off_the_record_profile); |
+ |
// BrowserContextKeyedBaseFactory: |
virtual void BrowserContextShutdown( |
- content::BrowserContext* profile) OVERRIDE; |
+ content::BrowserContext* context) OVERRIDE; |
virtual void SetEmptyTestingFactory( |
- content::BrowserContext* profile) OVERRIDE; |
- virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; |
+ content::BrowserContext* context) OVERRIDE; |
+ virtual void CreateServiceNow(content::BrowserContext* context) OVERRIDE; |
// Invoked by UserCloudPolicyManager to register/unregister instances. |
- void Register(Profile* profile, UserCloudPolicyManager* instance); |
- void Unregister(Profile* profile, UserCloudPolicyManager* instance); |
+ void Register(content::BrowserContext* context, |
+ UserCloudPolicyManager* instance); |
+ void Unregister(content::BrowserContext* context, |
+ UserCloudPolicyManager* instance); |
+ |
+ typedef std::map<content::BrowserContext*, UserCloudPolicyManager*> |
+ ManagerMap; |
- typedef std::map<Profile*, UserCloudPolicyManager*> ManagerMap; |
ManagerMap managers_; |
DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerFactory); |