| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 // Sends a device naming information (Asset Id and Location) to the | 166 // Sends a device naming information (Asset Id and Location) to the |
| 167 // device management server, uses OAuth2 token |auth_token| to identify user | 167 // device management server, uses OAuth2 token |auth_token| to identify user |
| 168 // who names a device, the |callback| will be called when the operation | 168 // who names a device, the |callback| will be called when the operation |
| 169 // completes. | 169 // completes. |
| 170 void UpdateDeviceAttributes(const std::string& auth_token, | 170 void UpdateDeviceAttributes(const std::string& auth_token, |
| 171 const std::string& asset_id, | 171 const std::string& asset_id, |
| 172 const std::string& location, | 172 const std::string& location, |
| 173 const StatusCallback& callback); | 173 const StatusCallback& callback); |
| 174 | 174 |
| 175 // Sends a GCM id update request to the DM server. The server will | |
| 176 // associate the DM token in authorization header with |gcm_id|, and | |
| 177 // |callback| will be called when the operation completes. | |
| 178 virtual void UpdateGcmId(const std::string& gcm_id, | |
| 179 const StatusCallback& callback); | |
| 180 | |
| 181 // Adds an observer to be called back upon policy and state changes. | 175 // Adds an observer to be called back upon policy and state changes. |
| 182 void AddObserver(Observer* observer); | 176 void AddObserver(Observer* observer); |
| 183 | 177 |
| 184 // Removes the specified observer. | 178 // Removes the specified observer. |
| 185 void RemoveObserver(Observer* observer); | 179 void RemoveObserver(Observer* observer); |
| 186 | 180 |
| 187 void set_submit_machine_id(bool submit_machine_id) { | 181 void set_submit_machine_id(bool submit_machine_id) { |
| 188 submit_machine_id_ = submit_machine_id; | 182 submit_machine_id_ = submit_machine_id; |
| 189 } | 183 } |
| 190 | 184 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 const StatusCallback& callback, | 315 const StatusCallback& callback, |
| 322 DeviceManagementStatus status, | 316 DeviceManagementStatus status, |
| 323 int net_error, | 317 int net_error, |
| 324 const enterprise_management::DeviceManagementResponse& response); | 318 const enterprise_management::DeviceManagementResponse& response); |
| 325 | 319 |
| 326 // Callback for device attribute update requests. | 320 // Callback for device attribute update requests. |
| 327 void OnDeviceAttributeUpdated( | 321 void OnDeviceAttributeUpdated( |
| 328 const DeviceManagementRequestJob* job, | 322 const DeviceManagementRequestJob* job, |
| 329 const StatusCallback& callback, | 323 const StatusCallback& callback, |
| 330 DeviceManagementStatus status, | 324 DeviceManagementStatus status, |
| 331 int net_error, | |
| 332 const enterprise_management::DeviceManagementResponse& response); | |
| 333 | |
| 334 // Callback for gcm id update requests. | |
| 335 void OnGcmIdUpdated( | |
| 336 const DeviceManagementRequestJob* job, | |
| 337 const StatusCallback& callback, | |
| 338 DeviceManagementStatus status, | |
| 339 int net_error, | 325 int net_error, |
| 340 const enterprise_management::DeviceManagementResponse& response); | 326 const enterprise_management::DeviceManagementResponse& response); |
| 341 | 327 |
| 342 // Helper to remove a job from request_jobs_. | 328 // Helper to remove a job from request_jobs_. |
| 343 void RemoveJob(const DeviceManagementRequestJob* job); | 329 void RemoveJob(const DeviceManagementRequestJob* job); |
| 344 | 330 |
| 345 // Observer notification helpers. | 331 // Observer notification helpers. |
| 346 void NotifyPolicyFetched(); | 332 void NotifyPolicyFetched(); |
| 347 void NotifyRegistrationStateChanged(); | 333 void NotifyRegistrationStateChanged(); |
| 348 void NotifyRobotAuthCodesFetched(); | 334 void NotifyRobotAuthCodesFetched(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 base::ObserverList<Observer, true> observers_; | 375 base::ObserverList<Observer, true> observers_; |
| 390 scoped_refptr<net::URLRequestContextGetter> request_context_; | 376 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 391 | 377 |
| 392 private: | 378 private: |
| 393 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); | 379 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); |
| 394 }; | 380 }; |
| 395 | 381 |
| 396 } // namespace policy | 382 } // namespace policy |
| 397 | 383 |
| 398 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ | 384 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ |
| OLD | NEW |