OLD | NEW |
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 #ifndef CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_FACTORY_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_FACTORY_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_FACTORY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // it is up to the tests themselves to free the objects after the profile is | 81 // it is up to the tests themselves to free the objects after the profile is |
82 // shut down. | 82 // shut down. |
83 void RegisterTestingFactory(TestingFactoryFunction factory); | 83 void RegisterTestingFactory(TestingFactoryFunction factory); |
84 void ClearTestingFactory(); | 84 void ClearTestingFactory(); |
85 | 85 |
86 private: | 86 private: |
87 class ManagerWrapper; | 87 class ManagerWrapper; |
88 friend struct DefaultSingletonTraits<UserCloudPolicyManagerFactory>; | 88 friend struct DefaultSingletonTraits<UserCloudPolicyManagerFactory>; |
89 | 89 |
90 UserCloudPolicyManagerFactory(); | 90 UserCloudPolicyManagerFactory(); |
91 virtual ~UserCloudPolicyManagerFactory(); | 91 ~UserCloudPolicyManagerFactory() override; |
92 | 92 |
93 // See comments for the static versions above. | 93 // See comments for the static versions above. |
94 UserCloudPolicyManager* GetManagerForBrowserContext( | 94 UserCloudPolicyManager* GetManagerForBrowserContext( |
95 content::BrowserContext* context); | 95 content::BrowserContext* context); |
96 | 96 |
97 scoped_ptr<UserCloudPolicyManager> CreateManagerForOriginalBrowserContext( | 97 scoped_ptr<UserCloudPolicyManager> CreateManagerForOriginalBrowserContext( |
98 content::BrowserContext* context, | 98 content::BrowserContext* context, |
99 bool force_immediate_load, | 99 bool force_immediate_load, |
100 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 100 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
101 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, | 101 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, |
102 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); | 102 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); |
103 | 103 |
104 UserCloudPolicyManager* RegisterManagerForOffTheRecordBrowserContext( | 104 UserCloudPolicyManager* RegisterManagerForOffTheRecordBrowserContext( |
105 content::BrowserContext* original_context, | 105 content::BrowserContext* original_context, |
106 content::BrowserContext* off_the_record_context); | 106 content::BrowserContext* off_the_record_context); |
107 | 107 |
108 // BrowserContextKeyedBaseFactory: | 108 // BrowserContextKeyedBaseFactory: |
109 virtual void BrowserContextShutdown( | 109 void BrowserContextShutdown(content::BrowserContext* context) override; |
110 content::BrowserContext* context) override; | 110 void BrowserContextDestroyed(content::BrowserContext* context) override; |
111 virtual void BrowserContextDestroyed( | 111 void SetEmptyTestingFactory(content::BrowserContext* context) override; |
112 content::BrowserContext* context) override; | 112 bool HasTestingFactory(content::BrowserContext* context) override; |
113 virtual void SetEmptyTestingFactory( | 113 void CreateServiceNow(content::BrowserContext* context) override; |
114 content::BrowserContext* context) override; | 114 bool ServiceIsCreatedWithBrowserContext() const override; |
115 virtual bool HasTestingFactory(content::BrowserContext* context) override; | |
116 virtual void CreateServiceNow(content::BrowserContext* context) override; | |
117 virtual bool ServiceIsCreatedWithBrowserContext() const override; | |
118 | |
119 | 115 |
120 typedef std::map<content::BrowserContext*, ManagerWrapper*> ManagerWrapperMap; | 116 typedef std::map<content::BrowserContext*, ManagerWrapper*> ManagerWrapperMap; |
121 | 117 |
122 ManagerWrapperMap manager_wrappers_; | 118 ManagerWrapperMap manager_wrappers_; |
123 TestingFactoryFunction testing_factory_; | 119 TestingFactoryFunction testing_factory_; |
124 | 120 |
125 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerFactory); | 121 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerFactory); |
126 }; | 122 }; |
127 | 123 |
128 } // namespace policy | 124 } // namespace policy |
129 | 125 |
130 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_FACTORY_H_ | 126 #endif // CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_MANAGER_FACTORY_H_ |
OLD | NEW |