Chromium Code Reviews| Index: chrome/browser/chromeos/policy/device_cloud_policy_initializer.h |
| diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_initializer.h b/chrome/browser/chromeos/policy/device_cloud_policy_initializer.h |
| index c976ed0219a2cbab6842a31df89b61246bf6d3e4..ff94fa256b43f86437a7c1f452d3d20c446e1b92 100644 |
| --- a/chrome/browser/chromeos/policy/device_cloud_policy_initializer.h |
| +++ b/chrome/browser/chromeos/policy/device_cloud_policy_initializer.h |
| @@ -5,6 +5,7 @@ |
| #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ |
| #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ |
| +#include <map> |
| #include <memory> |
| #include <string> |
| @@ -56,7 +57,11 @@ class EnrollmentStatus; |
| // handles the enrollment process. |
| class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer { |
| public: |
| + using EnrollmentLicenseMap = std::map<LicenseType, int>; |
| + |
| typedef base::Callback<void(EnrollmentStatus)> EnrollmentCallback; |
| + typedef base::Callback<void(const EnrollmentLicenseMap&)> |
|
achuithb
2017/07/31 21:03:23
We prefer using to typedef, and switch EnrollmentC
Denis Kuznetsov (DE-MUC)
2017/08/01 10:50:54
Done.
|
| + AvailableLicensesCallback; |
| // |background_task_runner| is used to execute long-running background tasks |
| // that may involve file I/O. |
| @@ -77,16 +82,28 @@ class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer { |
| virtual void Init(); |
| virtual void Shutdown(); |
| - // Starts enrollment or re-enrollment. Once the enrollment process completes, |
| - // |enrollment_callback| is invoked and gets passed the status of the |
| - // operation. |
| - virtual void StartEnrollment( |
| + // Prepares enrollment or re-enrollment. Enrollment should be started by |
| + // either calling StartEnrollment or CheckAvailableLicenses / |
| + // StartEnrollmentWithLicense. Once the enrollment process |
| + // completes, |enrollment_callback| is invoked and gets passed the status of |
| + // the operation. |
| + virtual void PrepareEnrollment( |
| DeviceManagementService* device_management_service, |
| chromeos::ActiveDirectoryJoinDelegate* ad_join_delegate, |
| const EnrollmentConfig& enrollment_config, |
| const std::string& auth_token, |
| const EnrollmentCallback& enrollment_callback); |
| + // Starts enrollment using server-based license type selection. |
| + virtual void StartEnrollment(); |
| + |
| + // Queries server about available license types and their count. |
| + virtual void CheckAvailableLicenses( |
| + const AvailableLicensesCallback& callback); |
| + |
| + // Starts enrollment using user-selected license type. |
| + virtual void StartEnrollmentWithLicense(policy::LicenseType license_type); |
| + |
| // Get the enrollment configuration that has been set up via signals such as |
| // device requisition, OEM manifest, pre-existing installation-time attributes |
| // or server-backed state retrieval. The configuration is stored in |config|, |