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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Allows testing code to inject UserCloudPolicyManager objects for tests. | 78 // Allows testing code to inject UserCloudPolicyManager objects for tests. |
79 // The factory function will be invoked for every Profile created. Because | 79 // The factory function will be invoked for every Profile created. Because |
80 // this class does not free the UserCloudPolicyManager objects it manages, | 80 // this class does not free the UserCloudPolicyManager objects it manages, |
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 base::DefaultSingletonTraits<UserCloudPolicyManagerFactory>; |
89 | 89 |
90 UserCloudPolicyManagerFactory(); | 90 UserCloudPolicyManagerFactory(); |
91 ~UserCloudPolicyManagerFactory() override; | 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, |
(...skipping 18 matching lines...) Expand all Loading... |
117 | 117 |
118 ManagerWrapperMap manager_wrappers_; | 118 ManagerWrapperMap manager_wrappers_; |
119 TestingFactoryFunction testing_factory_; | 119 TestingFactoryFunction testing_factory_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerFactory); | 121 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerFactory); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace policy | 124 } // namespace policy |
125 | 125 |
126 #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 |