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 1eab7e6fc54de81464a91b37edc227f1048dee59..a724b03cd407b75733a2abc9eb58216414ec2dda 100644 |
| --- a/chrome/browser/resources/options/manage_profile_overlay.js |
| +++ b/chrome/browser/resources/options/manage_profile_overlay.js |
| @@ -11,7 +11,7 @@ cr.define('options', function() { |
| * ManageProfileOverlay class |
| * Encapsulated handling of the 'Manage profile...' overlay page. |
| * @constructor |
| - * @class |
| + * @extends {cr.ui.pageManager.Page} |
| */ |
| function ManageProfileOverlay() { |
| Page.call(this, 'manageProfile', |
| @@ -352,6 +352,24 @@ cr.define('options', function() { |
| }, |
| /** |
| + * @param {Object} supervisedUser |
| + * @param {boolean} nameIsUnique |
| + */ |
| + getImportHandler_: function(supervisedUser, nameIsUnique) { |
| + return function() { |
| + if (supervisedUser.needAvatar || !nameIsUnique) { |
| + PageManager.showPageByName('supervisedUserImport'); |
| + } else { |
| + this.hideErrorBubble_('create'); |
| + CreateProfileOverlay.updateCreateInProgress(true); |
| + chrome.send('createProfile', |
| + [supervisedUser.name, supervisedUser.iconURL, false, true, |
| + supervisedUser.id]); |
| + } |
| + } |
|
Dan Beam
2014/09/09 19:05:48
}.bind(this);
|
| + }, |
| + |
| + /** |
| * Callback which receives the list of existing supervised users. Checks if |
| * the currently entered name is the name of an already existing supervised |
| * user. If yes, the user is prompted to import the existing supervised |
| @@ -386,22 +404,9 @@ cr.define('options', function() { |
| break; |
| } |
| } |
| - var self = this; |
| - function getImportHandler(supervisedUser, nameIsUnique) { |
| - return function() { |
| - if (supervisedUser.needAvatar || !nameIsUnique) { |
| - PageManager.showPageByName('supervisedUserImport'); |
| - } else { |
| - self.hideErrorBubble_('create'); |
| - CreateProfileOverlay.updateCreateInProgress(true); |
| - chrome.send('createProfile', |
| - [supervisedUser.name, supervisedUser.iconURL, false, true, |
| - supervisedUser.id]); |
| - } |
| - } |
| - }; |
| $('supervised-user-import-existing').onclick = |
| - getImportHandler(supervisedUsers[i], nameIsUnique); |
| + this.getImportHandler_(supervisedUsers[i], nameIsUnique) |
| + .bind(this); |
|
Dan Beam
2014/09/09 19:05:48
move bind() to getImportHandler_();
Vitaly Pavlenko
2014/09/09 21:26:05
Done.
|
| $('create-profile-ok').disabled = true; |
| return; |
| } |