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

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

Issue 2326063005: Use the device name instead of "device" in enrollment success messages. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 efe4d6adec6d249532a37f141ff24d293628e466..746c902af5bdbd4237a21f497334da665c73d3cf 100644
--- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "ash/common/system/chromeos/devicetype_utils.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
@@ -188,7 +189,8 @@ void EnrollmentScreenHandler::ShowEnrollmentSpinnerScreen() {
void EnrollmentScreenHandler::ShowAttestationBasedEnrollmentSuccessScreen(
const std::string& enterprise_domain) {
- CallJS("showAttestationBasedEnrollmentSuccess", enterprise_domain);
+ CallJS("showAttestationBasedEnrollmentSuccess", ash::GetChromeOSDeviceName(),
+ enterprise_domain);
}
void EnrollmentScreenHandler::ShowAuthError(
@@ -341,7 +343,7 @@ void EnrollmentScreenHandler::ShowEnrollmentStatus(
NOTREACHED();
return;
case policy::EnrollmentStatus::STATUS_ATTRIBUTE_UPDATE_FAILED:
- ShowError(IDS_ENTERPRISE_ENROLLMENT_ATTRIBUTE_ERROR, false);
+ ShowErrorForDevice(IDS_ENTERPRISE_ENROLLMENT_ATTRIBUTE_ERROR, false);
return;
}
NOTREACHED();
@@ -364,8 +366,8 @@ void EnrollmentScreenHandler::DeclareLocalizedValues(
builder->Add("oauthEnrollDone", IDS_ENTERPRISE_ENROLLMENT_DONE);
builder->Add("oauthEnrollNextBtn", IDS_OFFLINE_LOGIN_NEXT_BUTTON_TEXT);
builder->Add("oauthEnrollSkip", IDS_ENTERPRISE_ENROLLMENT_SKIP);
- builder->Add("oauthEnrollSuccess", IDS_ENTERPRISE_ENROLLMENT_SUCCESS);
- builder->Add("oauthEnrollAbeSuccess", IDS_ENTERPRISE_ENROLLMENT_ABE_SUCCESS);
+ builder->AddF("oauthEnrollSuccess", IDS_ENTERPRISE_ENROLLMENT_SUCCESS,
+ ash::GetChromeOSDeviceName());
builder->Add("oauthEnrollDeviceInformation",
IDS_ENTERPRISE_ENROLLMENT_DEVICE_INFORMATION);
builder->Add("oauthEnrollExplaneAttributeLink",
@@ -376,6 +378,8 @@ void EnrollmentScreenHandler::DeclareLocalizedValues(
IDS_ENTERPRISE_ENROLLMENT_ASSET_ID_LABEL);
builder->Add("oauthEnrollLocationLabel",
IDS_ENTERPRISE_ENROLLMENT_LOCATION_LABEL);
+ // Do not use AddF for this string as it will be rendered by the JS code.
+ builder->Add("oauthEnrollAbeSuccess", IDS_ENTERPRISE_ENROLLMENT_ABE_SUCCESS);
}
bool EnrollmentScreenHandler::IsOnEnrollmentScreen() const {
@@ -537,6 +541,12 @@ void EnrollmentScreenHandler::ShowError(int message_id, bool retry) {
ShowErrorMessage(l10n_util::GetStringUTF8(message_id), retry);
}
+void EnrollmentScreenHandler::ShowErrorForDevice(int message_id, bool retry) {
+ ShowErrorMessage(
+ l10n_util::GetStringFUTF8(message_id, ash::GetChromeOSDeviceName()),
+ retry);
+}
+
void EnrollmentScreenHandler::ShowErrorMessage(const std::string& message,
bool retry) {
CallJS("showError", message, retry);
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698