| OLD | NEW |
| 1 // Copyright (c) 2010 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_DEVICE_MANAGEMENT_BACKEND_IMPL_H_ | 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_IMPL_H_ |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_IMPL_H_ | 6 #define CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 29 // Name constants for URL query parameters. | 29 // Name constants for URL query parameters. |
| 30 static const char kParamRequest[]; | 30 static const char kParamRequest[]; |
| 31 static const char kParamDeviceType[]; | 31 static const char kParamDeviceType[]; |
| 32 static const char kParamAppType[]; | 32 static const char kParamAppType[]; |
| 33 static const char kParamDeviceID[]; | 33 static const char kParamDeviceID[]; |
| 34 static const char kParamAgent[]; | 34 static const char kParamAgent[]; |
| 35 | 35 |
| 36 // String constants for the device and app type we report to the server. | 36 // String constants for the device and app type we report to the server. |
| 37 static const char kValueRequestRegister[]; | 37 static const char kValueRequestRegister[]; |
| 38 static const char kValueRequestUnregister[]; | 38 static const char kValueRequestUnregister[]; |
| 39 // Deprecated in favor of kValueRequestCloudPolicy. | |
| 40 // See DevicePolicyResponseDelegate::HandlePolicyResponse. | |
| 41 static const char kValueRequestPolicy[]; | 39 static const char kValueRequestPolicy[]; |
| 42 static const char kValueRequestCloudPolicy[]; | |
| 43 static const char kValueDeviceType[]; | 40 static const char kValueDeviceType[]; |
| 44 static const char kValueAppType[]; | 41 static const char kValueAppType[]; |
| 45 | 42 |
| 46 private: | 43 private: |
| 47 friend class DeviceManagementJobBase; | 44 friend class DeviceManagementJobBase; |
| 48 | 45 |
| 49 typedef std::set<DeviceManagementJobBase*> JobSet; | 46 typedef std::set<DeviceManagementJobBase*> JobSet; |
| 50 | 47 |
| 51 // Called by the DeviceManagementJobBase dtor so we can clean up. | 48 // Called by the DeviceManagementJobBase dtor so we can clean up. |
| 52 void JobDone(DeviceManagementJobBase* job); | 49 void JobDone(DeviceManagementJobBase* job); |
| 53 | 50 |
| 54 // Add a job to the pending job set and register it with the service (if | 51 // Add a job to the pending job set and register it with the service (if |
| 55 // available). | 52 // available). |
| 56 void AddJob(DeviceManagementJobBase* job); | 53 void AddJob(DeviceManagementJobBase* job); |
| 57 | 54 |
| 58 // DeviceManagementBackend overrides. | 55 // DeviceManagementBackend overrides. |
| 59 virtual void ProcessRegisterRequest( | 56 virtual void ProcessRegisterRequest( |
| 60 const std::string& auth_token, | 57 const std::string& auth_token, |
| 61 const std::string& device_id, | 58 const std::string& device_id, |
| 62 const em::DeviceRegisterRequest& request, | 59 const em::DeviceRegisterRequest& request, |
| 63 DeviceRegisterResponseDelegate* response_delegate); | 60 DeviceRegisterResponseDelegate* response_delegate); |
| 64 virtual void ProcessUnregisterRequest( | 61 virtual void ProcessUnregisterRequest( |
| 65 const std::string& device_management_token, | 62 const std::string& device_management_token, |
| 66 const std::string& device_id, | 63 const std::string& device_id, |
| 67 const em::DeviceUnregisterRequest& request, | 64 const em::DeviceUnregisterRequest& request, |
| 68 DeviceUnregisterResponseDelegate* response_delegate); | 65 DeviceUnregisterResponseDelegate* response_delegate); |
| 69 // Deprecated in favor of ProcessCloudPolicyRequest. | |
| 70 // See DevicePolicyResponseDelegate::HandlePolicyResponse. | |
| 71 virtual void ProcessPolicyRequest( | 66 virtual void ProcessPolicyRequest( |
| 72 const std::string& device_management_token, | 67 const std::string& device_management_token, |
| 73 const std::string& device_id, | 68 const std::string& device_id, |
| 74 const em::DevicePolicyRequest& request, | 69 const em::DevicePolicyRequest& request, |
| 75 DevicePolicyResponseDelegate* response_delegate); | 70 DevicePolicyResponseDelegate* response_delegate); |
| 76 virtual void ProcessCloudPolicyRequest( | |
| 77 const std::string& device_management_token, | |
| 78 const std::string& device_id, | |
| 79 const em::CloudPolicyRequest& request, | |
| 80 DevicePolicyResponseDelegate* delegate); | |
| 81 | 71 |
| 82 // Keeps track of the jobs currently in flight. | 72 // Keeps track of the jobs currently in flight. |
| 83 JobSet pending_jobs_; | 73 JobSet pending_jobs_; |
| 84 | 74 |
| 85 DeviceManagementService* service_; | 75 DeviceManagementService* service_; |
| 86 | 76 |
| 87 DISALLOW_COPY_AND_ASSIGN(DeviceManagementBackendImpl); | 77 DISALLOW_COPY_AND_ASSIGN(DeviceManagementBackendImpl); |
| 88 }; | 78 }; |
| 89 | 79 |
| 90 } // namespace policy | 80 } // namespace policy |
| 91 | 81 |
| 92 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_IMPL_H_ | 82 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_IMPL_H_ |
| OLD | NEW |