| 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 COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 virtual bool GetSessionStatus( | 80 virtual bool GetSessionStatus( |
| 81 enterprise_management::SessionStatusReportRequest* status) = 0; | 81 enterprise_management::SessionStatusReportRequest* status) = 0; |
| 82 | 82 |
| 83 // Called after the status information has successfully been submitted to | 83 // Called after the status information has successfully been submitted to |
| 84 // the server. | 84 // the server. |
| 85 virtual void OnSubmittedSuccessfully() = 0; | 85 virtual void OnSubmittedSuccessfully() = 0; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // |provider| and |service| are weak pointers and it's the caller's | 88 // |provider| and |service| are weak pointers and it's the caller's |
| 89 // responsibility to keep them valid for the lifetime of CloudPolicyClient. | 89 // responsibility to keep them valid for the lifetime of CloudPolicyClient. |
| 90 // |verification_key_hash| contains an identifier telling the DMServer which |
| 91 // verification key to use. |
| 90 CloudPolicyClient( | 92 CloudPolicyClient( |
| 91 const std::string& machine_id, | 93 const std::string& machine_id, |
| 92 const std::string& machine_model, | 94 const std::string& machine_model, |
| 95 const std::string& verification_key_hash, |
| 93 UserAffiliation user_affiliation, | 96 UserAffiliation user_affiliation, |
| 94 StatusProvider* provider, | 97 StatusProvider* provider, |
| 95 DeviceManagementService* service, | 98 DeviceManagementService* service, |
| 96 scoped_refptr<net::URLRequestContextGetter> request_context); | 99 scoped_refptr<net::URLRequestContextGetter> request_context); |
| 97 virtual ~CloudPolicyClient(); | 100 virtual ~CloudPolicyClient(); |
| 98 | 101 |
| 99 // Sets the DMToken, thereby establishing a registration with the server. A | 102 // Sets the DMToken, thereby establishing a registration with the server. A |
| 100 // policy fetch is not automatically issued but can be requested by calling | 103 // policy fetch is not automatically issued but can be requested by calling |
| 101 // FetchPolicy(). | 104 // FetchPolicy(). |
| 102 virtual void SetupRegistration(const std::string& dm_token, | 105 virtual void SetupRegistration(const std::string& dm_token, |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 251 |
| 249 // Observer notification helpers. | 252 // Observer notification helpers. |
| 250 void NotifyPolicyFetched(); | 253 void NotifyPolicyFetched(); |
| 251 void NotifyRegistrationStateChanged(); | 254 void NotifyRegistrationStateChanged(); |
| 252 void NotifyRobotAuthCodesFetched(); | 255 void NotifyRobotAuthCodesFetched(); |
| 253 void NotifyClientError(); | 256 void NotifyClientError(); |
| 254 | 257 |
| 255 // Data necessary for constructing policy requests. | 258 // Data necessary for constructing policy requests. |
| 256 const std::string machine_id_; | 259 const std::string machine_id_; |
| 257 const std::string machine_model_; | 260 const std::string machine_model_; |
| 261 const std::string verification_key_hash_; |
| 258 const UserAffiliation user_affiliation_; | 262 const UserAffiliation user_affiliation_; |
| 259 NamespaceSet namespaces_to_fetch_; | 263 NamespaceSet namespaces_to_fetch_; |
| 260 | 264 |
| 261 std::string dm_token_; | 265 std::string dm_token_; |
| 262 DeviceMode device_mode_; | 266 DeviceMode device_mode_; |
| 263 std::string client_id_; | 267 std::string client_id_; |
| 264 bool submit_machine_id_; | 268 bool submit_machine_id_; |
| 265 base::Time last_policy_timestamp_; | 269 base::Time last_policy_timestamp_; |
| 266 int public_key_version_; | 270 int public_key_version_; |
| 267 bool public_key_version_valid_; | 271 bool public_key_version_valid_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 288 ObserverList<Observer, true> observers_; | 292 ObserverList<Observer, true> observers_; |
| 289 scoped_refptr<net::URLRequestContextGetter> request_context_; | 293 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 290 | 294 |
| 291 private: | 295 private: |
| 292 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); | 296 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); |
| 293 }; | 297 }; |
| 294 | 298 |
| 295 } // namespace policy | 299 } // namespace policy |
| 296 | 300 |
| 297 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 301 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
| OLD | NEW |