| 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..0e2fd89a0c6de96129f9763181aef0c83bcd3905 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_.isAtLeastOneProfileUnlocked().then(
|
| + function() {
|
| + this.browserProxy_.launchGuestUser();
|
| + }.bind(this),
|
| + function() {
|
| + cr.webUIListenerCallback(
|
| + 'show-error-dialog',
|
| + 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_.isAtLeastOneProfileUnlocked().then(
|
| + function() {
|
| + // Event is caught by user-manager-pages.
|
| + this.fire('change-page', {page: 'create-user-page'});
|
| + }.bind(this),
|
| + function() {
|
| + cr.webUIListenerCallback(
|
| + 'show-error-dialog',
|
| + this.i18n('AddProfileAllProfilesLockedError'));
|
| + }.bind(this));
|
| }
|
| });
|
|
|