Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6510)

Unified Diff: chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc

Issue 2959853003: Add UI components for license type selection in ChromeOS login UI. (Closed)
Patch Set: Remove unused flex import Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
}

Powered by Google App Engine
This is Rietveld 408576698