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

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 comments 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..923ca50ba48cd7717183adb02734c3cd673f6abe 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,16 @@
* @private
*/
onLaunchGuestTap_: function(event) {
- this.browserProxy_.launchGuestUser();
+ this.browserProxy_.areAllProfilesLocked().then(
+ function(allProfilesLocked) {
+ if (!allProfilesLocked) {
+ this.browserProxy_.launchGuestUser();
+ } else {
+ cr.webUIListenerCallback(
dpapad 2016/05/31 21:05:51 The original intent of cr.webUIListenerCallback is
Moe 2016/05/31 22:14:05 b/c user_manager.js includes a bunch of legacy js
+ 'show-error-dialog',
+ this.i18n('BrowseAsGuestAllProfilesLockedError'));
+ }
+ }.bind(this));
},
/**
@@ -52,7 +65,16 @@
* @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 {
+ cr.webUIListenerCallback(
dpapad 2016/05/31 21:05:51 Same here.
Moe 2016/05/31 22:14:05 Done.
+ 'show-error-dialog',
+ this.i18n('AddProfileAllProfilesLockedError'));
+ }
+ }.bind(this));
}
});

Powered by Google App Engine
This is Rietveld 408576698