OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_POLICY_CONNECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/task.h" | 14 #include "base/task.h" |
15 #include "chrome/browser/policy/cloud_policy_data_store.h" | 15 #include "chrome/browser/policy/cloud_policy_data_store.h" |
| 16 #include "chrome/browser/policy/configuration_policy_handler_list.h" |
16 #include "chrome/browser/policy/enterprise_install_attributes.h" | 17 #include "chrome/browser/policy/enterprise_install_attributes.h" |
17 #include "content/common/notification_observer.h" | 18 #include "content/common/notification_observer.h" |
18 #include "content/common/notification_registrar.h" | 19 #include "content/common/notification_registrar.h" |
19 | 20 |
20 class FilePath; | 21 class FilePath; |
21 class TestingBrowserProcess; | 22 class TestingBrowserProcess; |
22 class TokenService; | 23 class TokenService; |
23 | 24 |
24 namespace policy { | 25 namespace policy { |
25 | 26 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Installs a token service for user policy. | 105 // Installs a token service for user policy. |
105 void SetUserPolicyTokenService(TokenService* token_service); | 106 void SetUserPolicyTokenService(TokenService* token_service); |
106 | 107 |
107 // Registers for user policy (if not already registered), using the passed | 108 // Registers for user policy (if not already registered), using the passed |
108 // OAuth V2 token for authentication. | 109 // OAuth V2 token for authentication. |
109 void RegisterForUserPolicy(const std::string& oauth_token); | 110 void RegisterForUserPolicy(const std::string& oauth_token); |
110 | 111 |
111 const CloudPolicyDataStore* GetDeviceCloudPolicyDataStore() const; | 112 const CloudPolicyDataStore* GetDeviceCloudPolicyDataStore() const; |
112 const CloudPolicyDataStore* GetUserCloudPolicyDataStore() const; | 113 const CloudPolicyDataStore* GetUserCloudPolicyDataStore() const; |
113 | 114 |
| 115 const HandlerList* GetConfigurationPolicyHandlerList() const; |
| 116 |
114 private: | 117 private: |
115 friend class ::TestingBrowserProcess; | 118 friend class ::TestingBrowserProcess; |
116 | 119 |
117 BrowserPolicyConnector(); | 120 BrowserPolicyConnector(); |
118 | 121 |
119 // Constructor for tests that allows tests to use fake platform and cloud | 122 // Constructor for tests that allows tests to use fake platform and cloud |
120 // policy providers instead of using the actual ones. | 123 // policy providers instead of using the actual ones. |
121 BrowserPolicyConnector( | 124 BrowserPolicyConnector( |
122 ConfigurationPolicyProvider* managed_platform_provider, | 125 ConfigurationPolicyProvider* managed_platform_provider, |
123 ConfigurationPolicyProvider* recommended_platform_provider, | 126 ConfigurationPolicyProvider* recommended_platform_provider, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 167 |
165 ScopedRunnableMethodFactory<BrowserPolicyConnector> method_factory_; | 168 ScopedRunnableMethodFactory<BrowserPolicyConnector> method_factory_; |
166 | 169 |
167 // Registers the provider for notification of successful Gaia logins. | 170 // Registers the provider for notification of successful Gaia logins. |
168 NotificationRegistrar registrar_; | 171 NotificationRegistrar registrar_; |
169 | 172 |
170 // Weak reference to the TokenService we are listening to for user cloud | 173 // Weak reference to the TokenService we are listening to for user cloud |
171 // policy authentication tokens. | 174 // policy authentication tokens. |
172 TokenService* token_service_; | 175 TokenService* token_service_; |
173 | 176 |
| 177 // List of all available handlers derived from the |
| 178 // ConfigurationPolicyHandlerInterface. |
| 179 HandlerList policy_handlers_; |
| 180 |
174 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); | 181 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); |
175 }; | 182 }; |
176 | 183 |
177 } // namespace policy | 184 } // namespace policy |
178 | 185 |
179 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 186 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
OLD | NEW |