| 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..93a30744a4ef83110d0d6b0225110a10674c9ac9 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,10 @@ class EnrollmentStatus;
|
| // handles the enrollment process.
|
| class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer {
|
| public:
|
| - typedef base::Callback<void(EnrollmentStatus)> EnrollmentCallback;
|
| + using EnrollmentLicenseMap = std::map<LicenseType, int>;
|
| + using EnrollmentCallback = base::Callback<void(EnrollmentStatus)>;
|
| + using AvailableLicensesCallback =
|
| + base::Callback<void(const EnrollmentLicenseMap&)>;
|
|
|
| // |background_task_runner| is used to execute long-running background tasks
|
| // that may involve file I/O.
|
| @@ -77,16 +81,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|,
|
|
|