| 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/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/policy/cloud_policy_data_store.h" | 14 #include "chrome/browser/policy/cloud_policy_data_store.h" |
| 15 #include "chrome/browser/policy/configuration_policy_handler.h" |
| 15 #include "chrome/browser/policy/enterprise_install_attributes.h" | 16 #include "chrome/browser/policy/enterprise_install_attributes.h" |
| 16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 18 | 19 |
| 19 class TestingBrowserProcess; | 20 class TestingBrowserProcess; |
| 20 class TokenService; | 21 class TokenService; |
| 21 | 22 |
| 22 namespace policy { | 23 namespace policy { |
| 23 | 24 |
| 24 class CloudPolicyProvider; | 25 class CloudPolicyProvider; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Installs a token service for user policy. | 102 // Installs a token service for user policy. |
| 102 void SetUserPolicyTokenService(TokenService* token_service); | 103 void SetUserPolicyTokenService(TokenService* token_service); |
| 103 | 104 |
| 104 // Registers for user policy (if not already registered), using the passed | 105 // Registers for user policy (if not already registered), using the passed |
| 105 // OAuth V2 token for authentication. | 106 // OAuth V2 token for authentication. |
| 106 void RegisterForUserPolicy(const std::string& oauth_token); | 107 void RegisterForUserPolicy(const std::string& oauth_token); |
| 107 | 108 |
| 108 const CloudPolicyDataStore* GetDeviceCloudPolicyDataStore() const; | 109 const CloudPolicyDataStore* GetDeviceCloudPolicyDataStore() const; |
| 109 const CloudPolicyDataStore* GetUserCloudPolicyDataStore() const; | 110 const CloudPolicyDataStore* GetUserCloudPolicyDataStore() const; |
| 110 | 111 |
| 112 const ConfigurationPolicyHandler::HandlerList* |
| 113 GetConfigurationPolicyHandlerList() const; |
| 114 |
| 111 private: | 115 private: |
| 112 friend class ::TestingBrowserProcess; | 116 friend class ::TestingBrowserProcess; |
| 113 | 117 |
| 114 BrowserPolicyConnector(); | 118 BrowserPolicyConnector(); |
| 115 | 119 |
| 116 // Constructor for tests that allows tests to use fake platform and cloud | 120 // Constructor for tests that allows tests to use fake platform and cloud |
| 117 // policy providers instead of using the actual ones. | 121 // policy providers instead of using the actual ones. |
| 118 BrowserPolicyConnector( | 122 BrowserPolicyConnector( |
| 119 ConfigurationPolicyProvider* managed_platform_provider, | 123 ConfigurationPolicyProvider* managed_platform_provider, |
| 120 ConfigurationPolicyProvider* recommended_platform_provider, | 124 ConfigurationPolicyProvider* recommended_platform_provider, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // are spinning. | 167 // are spinning. |
| 164 base::WeakPtrFactory<BrowserPolicyConnector> weak_ptr_factory_; | 168 base::WeakPtrFactory<BrowserPolicyConnector> weak_ptr_factory_; |
| 165 | 169 |
| 166 // Registers the provider for notification of successful Gaia logins. | 170 // Registers the provider for notification of successful Gaia logins. |
| 167 content::NotificationRegistrar registrar_; | 171 content::NotificationRegistrar registrar_; |
| 168 | 172 |
| 169 // 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 |
| 170 // policy authentication tokens. | 174 // policy authentication tokens. |
| 171 TokenService* token_service_; | 175 TokenService* token_service_; |
| 172 | 176 |
| 177 // List of all available handlers derived from ConfigurationPolicyHandler. |
| 178 scoped_ptr<ConfigurationPolicyHandler::HandlerList> policy_handlers_; |
| 179 |
| 173 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); | 180 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); |
| 174 }; | 181 }; |
| 175 | 182 |
| 176 } // namespace policy | 183 } // namespace policy |
| 177 | 184 |
| 178 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 185 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
| OLD | NEW |