| Index: chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
|
| diff --git a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
|
| index b6cc4220a1c60e349b01ae6671d361ce8bd8c955..555e6f5ac0064eeee6e2885dd44e818cfcd5e67e 100644
|
| --- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
|
| +++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
|
| @@ -44,6 +44,7 @@ const char kJsScreenPath[] = "login.OAuthEnrollmentScreen";
|
| // Enrollment step names.
|
| const char kEnrollmentStepSignin[] = "signin";
|
| const char kEnrollmentStepAdJoin[] = "ad-join";
|
| +const char kEnrollmentStepPickLicense[] = "license";
|
| const char kEnrollmentStepSuccess[] = "success";
|
| const char kEnrollmentStepWorking[] = "working";
|
|
|
| @@ -149,6 +150,8 @@ void EnrollmentScreenHandler::RegisterMessages() {
|
| &EnrollmentScreenHandler::HandleDeviceAttributesProvided);
|
| AddCallback("oauthEnrollOnLearnMore",
|
| &EnrollmentScreenHandler::HandleOnLearnMore);
|
| + AddCallback("onLicenseTypeSelected",
|
| + &EnrollmentScreenHandler::HandleLicenseTypeSelected);
|
| }
|
|
|
| // EnrollmentScreenHandler
|
| @@ -177,6 +180,12 @@ void EnrollmentScreenHandler::ShowSigninScreen() {
|
| ShowStep(kEnrollmentStepSignin);
|
| }
|
|
|
| +void EnrollmentScreenHandler::ShowLicenseTypeSelectionScreen(
|
| + const base::DictionaryValue& license_types) {
|
| + CallJS("setAvailableLicenseTypes", license_types);
|
| + ShowStep(kEnrollmentStepPickLicense);
|
| +}
|
| +
|
| void EnrollmentScreenHandler::ShowAdJoin() {
|
| observe_network_failure_ = false;
|
| if (!authpolicy_login_helper_)
|
| @@ -358,6 +367,9 @@ void EnrollmentScreenHandler::ShowEnrollmentStatus(
|
| ShowError(IDS_ENTERPRISE_ENROLLMENT_ERROR_SAVE_DEVICE_CONFIGURATION,
|
| false);
|
| return;
|
| + case policy::EnrollmentStatus::LICENSE_REQUEST_FAILED:
|
| + ShowError(IDS_ENTERPRISE_ENROLLMENT_ERROR_LICENSE_REQUEST, false);
|
| + return;
|
| }
|
| NOTREACHED();
|
| }
|
| @@ -404,6 +416,18 @@ void EnrollmentScreenHandler::DeclareLocalizedValues(
|
| builder->Add("adLoginInvalidPassword", IDS_AD_INVALID_PASSWORD);
|
| builder->Add("adJoinErrorMachineNameInvalid", IDS_AD_MACHINENAME_INVALID);
|
| builder->Add("adJoinErrorMachineNameTooLong", IDS_AD_MACHINENAME_TOO_LONG);
|
| + builder->Add("licenseSelectionCardTitle",
|
| + IDS_ENTERPRISE_ENROLLMENT_LICENSE_SELECTION);
|
| + builder->Add("licenseSelectionCardExplanation",
|
| + IDS_ENTERPRISE_ENROLLMENT_LICENSE_SELECTION_EXPLANATION);
|
| + builder->Add("perpetualLicenseTypeTitle",
|
| + IDS_ENTERPRISE_ENROLLMENT_PERPETUAL_LICENSE_TYPE);
|
| + builder->Add("annualLicenseTypeTitle",
|
| + IDS_ENTERPRISE_ENROLLMENT_ANNUAL_LICENSE_TYPE);
|
| + builder->Add("kioskLicenseTypeTitle",
|
| + IDS_ENTERPRISE_ENROLLMENT_KIOSK_LICENSE_TYPE);
|
| + builder->Add("licenseCountTemplate",
|
| + IDS_ENTERPRISE_ENROLLMENT_LICENSES_REMAINING_TEMPLATE);
|
| }
|
|
|
| bool EnrollmentScreenHandler::IsOnEnrollmentScreen() const {
|
| @@ -619,6 +643,11 @@ void EnrollmentScreenHandler::HandleOnLearnMore() {
|
| help_app_->ShowHelpTopic(HelpAppLauncher::HELP_DEVICE_ATTRIBUTES);
|
| }
|
|
|
| +void EnrollmentScreenHandler::HandleLicenseTypeSelected(
|
| + const std::string& licenseType) {
|
| + controller_->OnLicenseTypeSelected(licenseType);
|
| +}
|
| +
|
| void EnrollmentScreenHandler::ShowStep(const char* step) {
|
| CallJS("showStep", std::string(step));
|
| }
|
|
|