OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 class DeviceCloudPolicyStoreChromeOS; | 49 class DeviceCloudPolicyStoreChromeOS; |
50 class DeviceManagementService; | 50 class DeviceManagementService; |
51 struct EnrollmentConfig; | 51 struct EnrollmentConfig; |
52 class EnrollmentHandlerChromeOS; | 52 class EnrollmentHandlerChromeOS; |
53 class EnrollmentStatus; | 53 class EnrollmentStatus; |
54 | 54 |
55 // This class connects DCPM to the correct device management service, and | 55 // This class connects DCPM to the correct device management service, and |
56 // handles the enrollment process. | 56 // handles the enrollment process. |
57 class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer { | 57 class DeviceCloudPolicyInitializer : public CloudPolicyStore::Observer { |
58 public: | 58 public: |
59 using EnrollmentLicenseMap = std::map<::policy::LicenseType, int>; | |
emaxx
2017/07/21 12:57:30
You have the same definition put into enterprise_e
emaxx
2017/07/21 12:57:30
nit: #include <map>
emaxx
2017/07/21 12:57:30
nit: s/::policy//
Denis Kuznetsov (DE-MUC)
2017/07/25 21:51:06
Done.
| |
60 | |
59 typedef base::Callback<void(EnrollmentStatus)> EnrollmentCallback; | 61 typedef base::Callback<void(EnrollmentStatus)> EnrollmentCallback; |
62 typedef base::Callback<void(const EnrollmentLicenseMap&)> | |
63 LicenseSelectionCallback; | |
emaxx
2017/07/21 12:57:30
nit: Maybe "AvailableLicensesCallback"?
Denis Kuznetsov (DE-MUC)
2017/07/25 21:51:06
Done.
| |
60 | 64 |
61 // |background_task_runner| is used to execute long-running background tasks | 65 // |background_task_runner| is used to execute long-running background tasks |
62 // that may involve file I/O. | 66 // that may involve file I/O. |
63 DeviceCloudPolicyInitializer( | 67 DeviceCloudPolicyInitializer( |
64 PrefService* local_state, | 68 PrefService* local_state, |
65 DeviceManagementService* enterprise_service, | 69 DeviceManagementService* enterprise_service, |
66 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 70 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
67 chromeos::InstallAttributes* install_attributes, | 71 chromeos::InstallAttributes* install_attributes, |
68 ServerBackedStateKeysBroker* state_keys_broker, | 72 ServerBackedStateKeysBroker* state_keys_broker, |
69 DeviceCloudPolicyStoreChromeOS* device_store, | 73 DeviceCloudPolicyStoreChromeOS* device_store, |
70 DeviceCloudPolicyManagerChromeOS* manager, | 74 DeviceCloudPolicyManagerChromeOS* manager, |
71 cryptohome::AsyncMethodCaller* async_method_caller, | 75 cryptohome::AsyncMethodCaller* async_method_caller, |
72 std::unique_ptr<chromeos::attestation::AttestationFlow> attestation_flow, | 76 std::unique_ptr<chromeos::attestation::AttestationFlow> attestation_flow, |
73 chromeos::system::StatisticsProvider* statistics_provider); | 77 chromeos::system::StatisticsProvider* statistics_provider); |
74 | 78 |
75 ~DeviceCloudPolicyInitializer() override; | 79 ~DeviceCloudPolicyInitializer() override; |
76 | 80 |
77 virtual void Init(); | 81 virtual void Init(); |
78 virtual void Shutdown(); | 82 virtual void Shutdown(); |
79 | 83 |
80 // Starts enrollment or re-enrollment. Once the enrollment process completes, | 84 // Prepares enrollment or re-enrollment. Enrollment should be started by |
81 // |enrollment_callback| is invoked and gets passed the status of the | 85 // either calling StartEnrollment or CheckAvailableLicenses / |
82 // operation. | 86 // StartEnrollmentWithLicense. Once the enrollment process |
83 virtual void StartEnrollment( | 87 // completes, |enrollment_callback| is invoked and gets passed the status of |
88 // the operation. | |
89 virtual void PrepareEnrollment( | |
84 DeviceManagementService* device_management_service, | 90 DeviceManagementService* device_management_service, |
85 chromeos::ActiveDirectoryJoinDelegate* ad_join_delegate, | 91 chromeos::ActiveDirectoryJoinDelegate* ad_join_delegate, |
86 const EnrollmentConfig& enrollment_config, | 92 const EnrollmentConfig& enrollment_config, |
87 const std::string& auth_token, | 93 const std::string& auth_token, |
88 const EnrollmentCallback& enrollment_callback); | 94 const EnrollmentCallback& enrollment_callback); |
89 | 95 |
96 // Starts enrollment using server-based license type selection. | |
97 virtual void StartEnrollment(); | |
98 | |
99 // Queries server about available license types and their count. | |
100 virtual void CheckAvailableLicenses(const LicenseSelectionCallback& callback); | |
101 | |
102 // Starts enrollment using user-selected license type. | |
103 virtual void StartEnrollmentWithLicense(policy::LicenseType license_type); | |
104 | |
90 // Get the enrollment configuration that has been set up via signals such as | 105 // Get the enrollment configuration that has been set up via signals such as |
91 // device requisition, OEM manifest, pre-existing installation-time attributes | 106 // device requisition, OEM manifest, pre-existing installation-time attributes |
92 // or server-backed state retrieval. The configuration is stored in |config|, | 107 // or server-backed state retrieval. The configuration is stored in |config|, |
93 // |config.mode| will be MODE_NONE if there is no prescribed configuration. | 108 // |config.mode| will be MODE_NONE if there is no prescribed configuration. |
94 // |config.management_domain| will contain the domain the device is supposed | 109 // |config.management_domain| will contain the domain the device is supposed |
95 // to be enrolled to as decided by factors such as forced re-enrollment, | 110 // to be enrolled to as decided by factors such as forced re-enrollment, |
96 // enrollment recovery, or already-present install attributes. Note that | 111 // enrollment recovery, or already-present install attributes. Note that |
97 // |config.management_domain| may be non-empty even if |config.mode| is | 112 // |config.management_domain| may be non-empty even if |config.mode| is |
98 // MODE_NONE. | 113 // MODE_NONE. |
99 EnrollmentConfig GetPrescribedEnrollmentConfig() const; | 114 EnrollmentConfig GetPrescribedEnrollmentConfig() const; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 | 178 |
164 // Our signing service. | 179 // Our signing service. |
165 std::unique_ptr<SigningService> signing_service_; | 180 std::unique_ptr<SigningService> signing_service_; |
166 | 181 |
167 DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyInitializer); | 182 DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyInitializer); |
168 }; | 183 }; |
169 | 184 |
170 } // namespace policy | 185 } // namespace policy |
171 | 186 |
172 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 187 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ |
OLD | NEW |