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

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: Address comments + Avoid breaking the tests 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..ed166dd86c70315c69b1f7e4a8d2b79793f1c7b8 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));
}
});

Powered by Google App Engine
This is Rietveld 408576698