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..dcdcc1a273c0210913a60be866fe2adc32caec31 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]); |
+ } |
+ }).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,8 @@ 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); |
$('create-profile-ok').disabled = true; |
return; |
} |