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

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

Issue 975353002: Added OOBE Asset / Naming prompt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 9da1f6a375c1359a56f9037e45b0ab6e7d720d07..41d2903d88f533f7728fd104f7e87e16e6655102 100644
--- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
@@ -40,6 +40,7 @@ const char kJsScreenPath[] = "login.OAuthEnrollmentScreen";
const char kEnrollmentStepSignin[] = "signin";
const char kEnrollmentStepSuccess[] = "success";
const char kEnrollmentStepWorking[] = "working";
+const char kEnrollmentStepNaming[] = "naming";
// Enrollment mode constants used in the UI. This needs to be kept in sync with
// oobe_screen_oauth_enrollment.js.
@@ -148,6 +149,8 @@ void EnrollmentScreenHandler::RegisterMessages() {
&EnrollmentScreenHandler::HandleRetry);
AddCallback("frameLoadingCompleted",
&EnrollmentScreenHandler::HandleFrameLoadingCompleted);
+ AddCallback("oauthEnrollNaming",
+ &EnrollmentScreenHandler::HandleDeviceNaming);
}
// EnrollmentScreenHandler
@@ -184,6 +187,17 @@ void EnrollmentScreenHandler::ShowSigninScreen() {
ShowStep(kEnrollmentStepSignin);
}
+void EnrollmentScreenHandler::ShowDeviceNamingScreen() {
+ base::DictionaryValue data;
+
+ // TODO: add existing Asset ID and Location values.
+ data.SetString("device_asset_id", "Asset Identifier");
+ data.SetString("device_location", "Location");
+
+ OnBeforeShowNaming(data);
+ ShowStep(kEnrollmentStepNaming);
+}
+
void EnrollmentScreenHandler::ShowEnrollmentSpinnerScreen() {
ShowStep(kEnrollmentStepWorking);
}
@@ -327,6 +341,9 @@ void EnrollmentScreenHandler::ShowEnrollmentStatus(
true);
NOTREACHED();
return;
+ case policy::EnrollmentStatus::STATUS_DEVICE_NAMING_FAILED:
+ ShowError(IDS_ENTERPRISE_ENROLLMENT_DEVICE_NAMING_ERROR, false);
+ return;
}
NOTREACHED();
}
@@ -351,10 +368,16 @@ void EnrollmentScreenHandler::DeclareLocalizedValues(
builder->Add("oauthEnrollCancel", IDS_ENTERPRISE_ENROLLMENT_CANCEL);
builder->Add("oauthEnrollBack", IDS_ENTERPRISE_ENROLLMENT_BACK);
builder->Add("oauthEnrollDone", IDS_ENTERPRISE_ENROLLMENT_DONE);
+ builder->Add("oauthEnrollContinue", IDS_ENTERPRISE_ENROLLMENT_CONTINUE);
builder->Add("oauthEnrollSuccess", IDS_ENTERPRISE_ENROLLMENT_SUCCESS);
+ builder->Add("oauthEnrollNaming", IDS_ENTERPRISE_ENROLLMENT_NAMING);
builder->Add("oauthEnrollExplainLink",
IDS_ENTERPRISE_ENROLLMENT_EXPLAIN_LINK);
builder->Add("oauthEnrollWorking", IDS_ENTERPRISE_ENROLLMENT_WORKING);
+ builder->Add("oauthEnrollAssetIdLabel",
+ IDS_ENTERPRISE_ENROLLMENT_ASSET_ID_LABEL);
+ builder->Add("oauthEnrollLocationLabel",
+ IDS_ENTERPRISE_ENROLLMENT_LOCATION_LABEL);
}
OobeUI::Screen EnrollmentScreenHandler::GetCurrentScreen() const {
@@ -514,6 +537,22 @@ void EnrollmentScreenHandler::HandleFrameLoadingCompleted(int status) {
UpdateState(NetworkError::ERROR_REASON_UPDATE);
}
+void EnrollmentScreenHandler::HandleDeviceNaming(const std::string& asset_id,
+ const std::string& location) {
+
+ // TODO: add the device attribute update request
+ // If DeviceAttributeUpdateResponse SUCCESS then status = 0
+ int status = 1;
+ if (status != 0) {
+ // Show DeviceAttributeUpdate error
+ ShowEnrollmentStatus(policy::EnrollmentStatus::ForStatus(
+ policy::EnrollmentStatus::STATUS_DEVICE_NAMING_FAILED));
+ } else {
+ ShowEnrollmentStatus(policy::EnrollmentStatus::ForStatus(
+ policy::EnrollmentStatus::STATUS_SUCCESS));
+ }
+}
+
void EnrollmentScreenHandler::ShowStep(const char* step) {
CallJS("showStep", std::string(step));
}
@@ -552,4 +591,9 @@ void EnrollmentScreenHandler::DoShow() {
histogram_helper_->OnScreenShow();
}
+void EnrollmentScreenHandler::OnBeforeShowNaming(
+ const base::DictionaryValue& data) {
+ CallJS("onBeforeShowNaming", data);
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698