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..874021e7a95d68aa3c84c43e4e167293202f4fa9 100644 |
| --- a/chrome/browser/resources/options/manage_profile_overlay.js |
| +++ b/chrome/browser/resources/options/manage_profile_overlay.js |
| @@ -371,6 +371,12 @@ cr.define('options', function() { |
| * @private |
| */ |
| receiveExistingSupervisedUsers_: function(supervisedUsers) { |
| + // After a supervised user has been created and the dialog has been |
| + // hidden, this gets called again with a list including |
| + // the just-created SU. Ignore, to prevent the "already exists" bubble |
| + // from showing up if the overlay is already hidden. |
| + if (PageManager.getTopmostVisiblePage().pageDiv != this.pageDiv) |
|
Pam (message me for reviews)
2016/01/11 18:32:37
Do we actually need to skip this if the dialog is
atanasova
2016/01/13 16:55:07
Unfortunately, if we do not check on reopening the
Pam (message me for reviews)
2016/01/13 22:05:09
Sorry, I must have been unclear. I see that we nee
atanasova
2016/01/13 22:08:52
I tested it out and the problem was not there usin
|
| + return; |
| $('import-existing-supervised-user-link').hidden = |
| supervisedUsers.length === 0; |
| if (!$('create-profile-supervised').checked) |
| @@ -406,8 +412,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')) { |
| + $('supervised-user-import-existing').onclick = |
| + this.getImportHandler_(supervisedUsers[i], nameIsUnique); |
| + } |
| $('create-profile-ok').disabled = true; |
| return; |
| } |