Chromium Code Reviews| Index: chrome/browser/resources/options/manage_profile_overlay.js |
| diff --git a/chrome/browser/resources/options/manage_profile_overlay.js b/chrome/browser/resources/options/manage_profile_overlay.js |
| index 4e9ae665c28f6d89104fb7b4fb7d78c76e73bbbe..c881350c595f3f11e8f0556d4b81198485e92e0d 100644 |
| --- a/chrome/browser/resources/options/manage_profile_overlay.js |
| +++ b/chrome/browser/resources/options/manage_profile_overlay.js |
| @@ -371,6 +371,11 @@ cr.define('options', function() { |
| * @private |
| */ |
| receiveExistingSupervisedUsers_: function(supervisedUsers) { |
| + // Because the callback is called after the supervised user is created |
|
Marc Treib
2016/01/07 14:42:48
Hm, this kinda makes it sound like that's the only
atanasova
2016/01/07 15:03:10
Done.
|
| + // and before the overlay is closed, the error bubble is shown. That |
| + // causes the hiding animation to be shown when you reopen the dialog. |
| + if (CreateProfileOverlay.getCreateInProgress()) |
| + return; |
| $('import-existing-supervised-user-link').hidden = |
| supervisedUsers.length === 0; |
| if (!$('create-profile-supervised').checked) |
| @@ -406,8 +411,10 @@ cr.define('options', function() { |
| HTMLEscape(elide(newName, /* maxLength */ 50))); |
| this.showErrorBubble_(errorHtml, 'create', true); |
| - $('supervised-user-import-existing').onclick = |
| - this.getImportHandler_(supervisedUsers[i], nameIsUnique); |
| + if ($('supervised-user-import-existing')) { |
|
Marc Treib
2016/01/07 14:42:48
Why is this necessary?
atanasova
2016/01/07 15:03:10
If we display the error without the import option,
Marc Treib
2016/01/07 16:11:23
Ah, so it's a pre-existing problem? Okay then, car
|
| + $('supervised-user-import-existing').onclick = |
| + this.getImportHandler_(supervisedUsers[i], nameIsUnique); |
| + } |
| $('create-profile-ok').disabled = true; |
| return; |
| } |
| @@ -693,6 +700,15 @@ cr.define('options', function() { |
| }, |
| /** |
| + * Get createInProgress_. This is needed for the create user overlay. |
| + * We do not want to show the errorBubble if a profile is being created. |
|
Marc Treib
2016/01/07 14:42:48
Please describe what the method does, not what it'
atanasova
2016/01/07 15:03:10
Done.
|
| + * @private |
| + */ |
| + getCreateInProgress_: function() { |
| + return this.createInProgress_; |
| + }, |
| + |
| + /** |
| * Updates the UI when a profile create step begins or ends. |
| * Note that hideErrorBubble_() also enables the "OK" button, so it |
| * must be called before this function if both are used. |
| @@ -759,7 +775,6 @@ cr.define('options', function() { |
| * @private |
| */ |
| onSuccess_: function(profileInfo) { |
| - this.updateCreateInProgress_(false); |
|
Marc Treib
2016/01/07 14:42:48
Why remove this?
atanasova
2016/01/07 15:03:10
In the description I tried to explain it, but I no
Marc Treib
2016/01/07 16:11:23
Hm. I guess the callback being called does not nec
atanasova
2016/01/07 16:22:44
It is needed in the onError method, since then we
|
| PageManager.closeOverlay(); |
| if (profileInfo.isSupervised) { |
| options.SupervisedUserListData.resetPromise(); |
| @@ -867,6 +882,7 @@ cr.define('options', function() { |
| 'onError', |
| 'onSuccess', |
| 'onWarning', |
| + 'getCreateInProgress', |
| 'updateCreateInProgress', |
| 'updateSignedInStatus', |
| 'updateSupervisedUsersAllowed', |