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

Unified Diff: chrome/browser/resources/md_user_manager/control_bar.js

Issue 2025433002: MD User Manager: Display error message when all profiles are locked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 4 years, 7 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/resources/md_user_manager/control_bar.js
diff --git a/chrome/browser/resources/md_user_manager/control_bar.js b/chrome/browser/resources/md_user_manager/control_bar.js
index 3c2b6362923985860b326cf118c8863693892a23..f8ebe3cdf1d45b382785beb6ce0c5ac2d93b818b 100644
--- a/chrome/browser/resources/md_user_manager/control_bar.js
+++ b/chrome/browser/resources/md_user_manager/control_bar.js
@@ -9,6 +9,10 @@
Polymer({
is: 'control-bar',
+ behaviors: [
+ I18nBehavior,
+ ],
+
properties: {
/**
* True if 'Browse as Guest' button is displayed.
@@ -43,7 +47,15 @@
* @private
*/
onLaunchGuestTap_: function(event) {
- this.browserProxy_.launchGuestUser();
+ this.browserProxy_.areAllProfilesLocked().then(
+ function(allProfilesLocked) {
+ if (!allProfilesLocked) {
+ this.browserProxy_.launchGuestUser();
+ } else {
+ document.querySelector('error-dialog').show(
+ this.i18n('browseAsGuestAllProfilesLockedError'));
+ }
+ }.bind(this));
},
/**
@@ -52,7 +64,15 @@
* @private
*/
onAddUserTap_: function(event) {
- // Event is caught by user-manager-pages.
- this.fire('change-page', {page: 'create-user-page'});
+ this.browserProxy_.areAllProfilesLocked().then(
+ function(allProfilesLocked) {
+ if (!allProfilesLocked) {
+ // Event is caught by user-manager-pages.
+ this.fire('change-page', {page: 'create-user-page'});
+ } else {
+ document.querySelector('error-dialog').show(
+ this.i18n('addProfileAllProfilesLockedError'));
+ }
+ }.bind(this));
}
});
« no previous file with comments | « chrome/browser/resources/md_user_manager/control_bar.html ('k') | chrome/browser/resources/md_user_manager/error_dialog.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698