| Index: chrome/browser/resources/options/chromeos_accounts_options.js
|
| diff --git a/chrome/browser/resources/options/chromeos_accounts_options.js b/chrome/browser/resources/options/chromeos_accounts_options.js
|
| index 9830bfac85d6d49bbf64708ad7a9627c9fdff755..fa3810b20c88112703484e3dac094a663018326a 100644
|
| --- a/chrome/browser/resources/options/chromeos_accounts_options.js
|
| +++ b/chrome/browser/resources/options/chromeos_accounts_options.js
|
| @@ -37,30 +37,36 @@ cr.define('options', function() {
|
| OptionsPage.prototype.initializePage.call(this);
|
|
|
| // Set up accounts page.
|
| - $('addUserButton').onclick = function(e) {
|
| - OptionsPage.showOverlay('addUserOverlay');
|
| - };
|
| - $('removeUserButton').onclick = function(e) {
|
| - $('userList').removeSelectedUser();
|
| - };
|
| -
|
| options.accounts.UserList.decorate($('userList'));
|
|
|
| - this.addEventListener('visibleChange',
|
| - cr.bind(this.handleVisibleChange_, this));
|
| + var userNameEdit = $('userNameEdit');
|
| + options.accounts.UserNameEdit.decorate(userNameEdit);
|
| + userNameEdit.addEventListener('add', this.handleAddUser_);
|
| +
|
| + this.addEventListener('visibleChange', this.handleVisibleChange_);
|
| },
|
|
|
| userListInitalized_: false,
|
|
|
| /**
|
| * Handler for OptionsPage's visible property change event.
|
| + * @private
|
| * @param {Event} e Property change event.
|
| */
|
| - handleVisibleChange_ : function(e) {
|
| + handleVisibleChange_: function(e) {
|
| if (!this.userListInitalized_ && this.visible) {
|
| this.userListInitalized_ = true;
|
| userList.redraw();
|
| }
|
| + },
|
| +
|
| + /**
|
| + * Handler for "add" event fired from userNameEdit.
|
| + * @private
|
| + * @param {Event} e Add event fired from userNameEdit.
|
| + */
|
| + handleAddUser_: function(e) {
|
| + $('userList').addUser(e.user);
|
| }
|
| };
|
|
|
| @@ -70,4 +76,3 @@ cr.define('options', function() {
|
| };
|
|
|
| });
|
| -
|
|
|