Chromium Code Reviews| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 | 73 |
| 74 // Called when a request for device robot OAuth2 authorization tokens | 74 // Called when a request for device robot OAuth2 authorization tokens |
| 75 // returns successfully. Only occurs during enrollment. Optional | 75 // returns successfully. Only occurs during enrollment. Optional |
| 76 // (default implementation is a noop). | 76 // (default implementation is a noop). |
| 77 virtual void OnRobotAuthCodesFetched(CloudPolicyClient* client); | 77 virtual void OnRobotAuthCodesFetched(CloudPolicyClient* client); |
| 78 | 78 |
| 79 // Indicates there's been an error in a previously-issued request. | 79 // Indicates there's been an error in a previously-issued request. |
| 80 virtual void OnClientError(CloudPolicyClient* client) = 0; | 80 virtual void OnClientError(CloudPolicyClient* client) = 0; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 // |service| and |signing_service| are weak pointers and it's the caller's | 83 // |machine_id| and |machine_model| must only be provided for device |
| 84 // responsibility to keep them valid for the lifetime of CloudPolicyClient. | 84 // policy. (Pass empty strings for user policy to prevent leaking machine |
| 85 // |verification_key_hash| contains an identifier telling the DMServer which | 85 // details.) |service| and |signing_service| are weak pointers and it's the |
|
Mattias Nissler (ping if slow)
2016/09/27 13:48:45
nit: This suggests that bad the code will not work
| |
| 86 // verification key to use. The |signing_service| is used to sign sensitive | 86 // caller's responsibility to keep them valid for the lifetime of |
| 87 // requests. | 87 // CloudPolicyClient. |verification_key_hash| contains an identifier telling |
| 88 // the DMServer which verification key to use. The |signing_service| is used | |
| 89 // to sign sensitive requests. | |
| 88 CloudPolicyClient( | 90 CloudPolicyClient( |
| 89 const std::string& machine_id, | 91 const std::string& machine_id, |
| 90 const std::string& machine_model, | 92 const std::string& machine_model, |
| 91 const std::string& verification_key_hash, | 93 const std::string& verification_key_hash, |
| 92 DeviceManagementService* service, | 94 DeviceManagementService* service, |
| 93 scoped_refptr<net::URLRequestContextGetter> request_context, | 95 scoped_refptr<net::URLRequestContextGetter> request_context, |
| 94 SigningService* signing_service); | 96 SigningService* signing_service); |
| 95 virtual ~CloudPolicyClient(); | 97 virtual ~CloudPolicyClient(); |
| 96 | 98 |
| 97 // Sets the DMToken, thereby establishing a registration with the server. A | 99 // Sets the DMToken, thereby establishing a registration with the server. A |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 417 | 419 |
| 418 // Used to create tasks which run delayed on the UI thread. | 420 // Used to create tasks which run delayed on the UI thread. |
| 419 base::WeakPtrFactory<CloudPolicyClient> weak_ptr_factory_; | 421 base::WeakPtrFactory<CloudPolicyClient> weak_ptr_factory_; |
| 420 | 422 |
| 421 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); | 423 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); |
| 422 }; | 424 }; |
| 423 | 425 |
| 424 } // namespace policy | 426 } // namespace policy |
| 425 | 427 |
| 426 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 428 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
| OLD | NEW |