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 // If non-empty, |machine_id| and |machine_model| are passed to the server |
| 84 // verbatim. As these reveal machine identity, they must only be used where |
| 85 // this is appropriate (i.e. device policy, but not user policy). |service| |
| 86 // and |signing_service| are weak pointers and it's the caller's |
84 // responsibility to keep them valid for the lifetime of CloudPolicyClient. | 87 // responsibility to keep them valid for the lifetime of CloudPolicyClient. |
85 // |verification_key_hash| contains an identifier telling the DMServer which | 88 // |verification_key_hash| contains an identifier telling the DMServer which |
86 // verification key to use. The |signing_service| is used to sign sensitive | 89 // verification key to use. The |signing_service| is used to sign sensitive |
87 // requests. | 90 // requests. |
88 CloudPolicyClient( | 91 CloudPolicyClient( |
89 const std::string& machine_id, | 92 const std::string& machine_id, |
90 const std::string& machine_model, | 93 const std::string& machine_model, |
91 const std::string& verification_key_hash, | 94 const std::string& verification_key_hash, |
92 DeviceManagementService* service, | 95 DeviceManagementService* service, |
93 scoped_refptr<net::URLRequestContextGetter> request_context, | 96 scoped_refptr<net::URLRequestContextGetter> request_context, |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 420 |
418 // Used to create tasks which run delayed on the UI thread. | 421 // Used to create tasks which run delayed on the UI thread. |
419 base::WeakPtrFactory<CloudPolicyClient> weak_ptr_factory_; | 422 base::WeakPtrFactory<CloudPolicyClient> weak_ptr_factory_; |
420 | 423 |
421 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); | 424 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); |
422 }; | 425 }; |
423 | 426 |
424 } // namespace policy | 427 } // namespace policy |
425 | 428 |
426 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 429 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
OLD | NEW |