OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 | 7 |
8 ///////////////////////////////////////////////////////////////////////////// | 8 ///////////////////////////////////////////////////////////////////////////// |
9 // AccountsOptions class: | 9 // AccountsOptions class: |
10 | 10 |
11 /** | 11 /** |
12 * Encapsulated handling of ChromeOS accounts options page. | 12 * Encapsulated handling of ChromeOS accounts options page. |
13 * @constructor | 13 * @constructor |
14 */ | 14 */ |
15 function AccountsOptions(model) { | 15 function AccountsOptions(model) { |
16 OptionsPage.call(this, 'accounts', | 16 OptionsPage.call(this, 'accounts', |
17 loadTimeData.getString('accountsPageTabTitle'), | 17 loadTimeData.getString('accountsPageTabTitle'), |
18 'accountsPage'); | 18 'accountsPage'); |
19 // Whether to show the whitelist. | 19 // Whether to show the whitelist. |
20 this.showWhitelist_ = false; | 20 this.showWhitelist_ = false; |
21 } | 21 } |
22 | 22 |
23 cr.addSingletonGetter(AccountsOptions); | 23 cr.addSingletonGetter(AccountsOptions); |
24 | 24 |
25 AccountsOptions.prototype = { | 25 AccountsOptions.prototype = { |
26 // Inherit AccountsOptions from OptionsPage. | 26 // Inherit AccountsOptions from OptionsPage. |
27 __proto__: OptionsPage.prototype, | 27 __proto__: OptionsPage.prototype, |
28 | 28 |
29 /** | 29 /** @override */ |
30 * Initializes AccountsOptions page. | |
31 */ | |
32 initializePage: function() { | 30 initializePage: function() { |
33 // Call base class implementation to starts preference initialization. | 31 // Call base class implementation to starts preference initialization. |
34 OptionsPage.prototype.initializePage.call(this); | 32 OptionsPage.prototype.initializePage.call(this); |
35 | 33 |
36 // Set up accounts page. | 34 // Set up accounts page. |
37 var userList = $('userList'); | 35 var userList = $('userList'); |
38 userList.addEventListener('remove', this.handleRemoveUser_); | 36 userList.addEventListener('remove', this.handleRemoveUser_); |
39 | 37 |
40 var userNameEdit = $('userNameEdit'); | 38 var userNameEdit = $('userNameEdit'); |
41 options.accounts.UserNameEdit.decorate(userNameEdit); | 39 options.accounts.UserNameEdit.decorate(userNameEdit); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (this.showWhitelist_) | 147 if (this.showWhitelist_) |
150 $('userList').updateAccountPicture(username); | 148 $('userList').updateAccountPicture(username); |
151 }; | 149 }; |
152 | 150 |
153 // Export | 151 // Export |
154 return { | 152 return { |
155 AccountsOptions: AccountsOptions | 153 AccountsOptions: AccountsOptions |
156 }; | 154 }; |
157 | 155 |
158 }); | 156 }); |
OLD | NEW |