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

Unified Diff: ui/login/account_picker/user_pod_row.js

Issue 2258043002: Update remove non-owner user warning message and fix the unwanted space (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/login/account_picker/user_pod_row.js
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index d14bb17465a6270b0efb3f7f50bba68943c5bf65..d8de3fb613d24c43142ec21422bfe0aa157a8ab2 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -1537,6 +1537,18 @@ cr.define('login', function() {
var message;
if (!this.user.isDesktopUser) {
this.moveActionMenuUpIfNeeded_();
+ if (!this.user.legacySupervisedUser) {
+ this.querySelector(
+ '.action-box-remove-user-warning-text').style.display = 'none';
+ this.querySelector(
+ '.action-box-remove-user-warning-table-nonsync').style.display
+ = 'none';
+ var message = loadTimeData.getString('removeNonOwnerUserWarningText');
+ var element_id = '.action-box-remove-non-owner-user-warning-text';
+ this.updateRemoveWarningDialogSetMessage_(element_id,
+ this.user.profilePath,
+ message);
+ }
} else {
this.querySelector(
'.action-box-remove-non-owner-user-warning-text').hidden = true;
@@ -1600,6 +1612,7 @@ cr.define('login', function() {
if (total_count)
this.classList.remove('has-no-stats');
+ var elementSelector = '.action-box-remove-user-warning-text';
var is_synced_user = this.user.emailAddress !== "";
// Write total number if all statistics are loaded.
if (num_stats_loaded === Object.keys(stats_elements).length) {
@@ -1608,7 +1621,8 @@ cr.define('login', function() {
var message = loadTimeData.getString(
is_synced_user ? 'removeUserWarningTextSyncNoStats' :
'removeUserWarningTextNonSyncNoStats');
- this.updateRemoveWarningDialogSetMessage_(this.user.profilePath,
+ this.updateRemoveWarningDialogSetMessage_(elementSelector,
+ this.user.profilePath,
message);
} else {
window.updateRemoveWarningDialogSetMessage =
@@ -1625,7 +1639,8 @@ cr.define('login', function() {
message = loadTimeData.getString(
is_synced_user ? 'removeUserWarningTextSyncNoStats' :
'removeUserWarningTextNonSyncNoStats');
- this.updateRemoveWarningDialogSetMessage_(this.user.profilePath,
+ this.updateRemoveWarningDialogSetMessage_(elementSelector,
+ this.user.profilePath,
message);
} else {
message = loadTimeData.getString(
@@ -1633,7 +1648,8 @@ cr.define('login', function() {
'removeUserWarningTextNonSyncCalculating');
substitute = loadTimeData.getString(
'removeUserWarningTextCalculating');
- this.updateRemoveWarningDialogSetMessage_(this.user.profilePath,
+ this.updateRemoveWarningDialogSetMessage_(elementSelector,
+ this.user.profilePath,
message, substitute);
}
}
@@ -1641,19 +1657,22 @@ cr.define('login', function() {
/**
* Refresh the message in the remove user warning dialog.
+ * @param {string} elementSelector The elementSelector of warning dialog.
* @param {string} profilePath The filepath of the URL (must be verified).
* @param {string} message The message to be written.
* @param {number|string=} count The number or string to replace $1 in
* |message|. Can be omitted if $1 is not present in |message|.
*/
- updateRemoveWarningDialogSetMessage_: function(profilePath, message,
+ updateRemoveWarningDialogSetMessage_: function(elementSelector,
+ profilePath,
+ message,
count) {
if (profilePath !== this.user.profilePath)
return;
// Add localized messages where $1 will be replaced with
// <span class="total-count"></span> and $2 will be replaced with
// <span class="email"></span>.
- var element = this.querySelector('.action-box-remove-user-warning-text');
+ var element = this.querySelector(elementSelector);
element.textContent = '';
messageParts = message.split(/(\$[12])/);
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698