| 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', templateData.accountsPageTabTitle, | 16 OptionsPage.call(this, 'accounts', |
| 17 loadTimeData.getString('accountsPageTabTitle'), |
| 17 'accountsPage'); | 18 'accountsPage'); |
| 18 // Whether to show the whitelist. | 19 // Whether to show the whitelist. |
| 19 this.showWhitelist_ = false; | 20 this.showWhitelist_ = false; |
| 20 } | 21 } |
| 21 | 22 |
| 22 cr.addSingletonGetter(AccountsOptions); | 23 cr.addSingletonGetter(AccountsOptions); |
| 23 | 24 |
| 24 AccountsOptions.prototype = { | 25 AccountsOptions.prototype = { |
| 25 // Inherit AccountsOptions from OptionsPage. | 26 // Inherit AccountsOptions from OptionsPage. |
| 26 __proto__: OptionsPage.prototype, | 27 __proto__: OptionsPage.prototype, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 handleRemoveUser_: function(e) { | 129 handleRemoveUser_: function(e) { |
| 129 chrome.send('unwhitelistUser', [e.user.username]); | 130 chrome.send('unwhitelistUser', [e.user.username]); |
| 130 } | 131 } |
| 131 }; | 132 }; |
| 132 | 133 |
| 133 | 134 |
| 134 /** | 135 /** |
| 135 * Returns whether the whitelist is managed by policy or not. | 136 * Returns whether the whitelist is managed by policy or not. |
| 136 */ | 137 */ |
| 137 AccountsOptions.whitelistIsManaged = function() { | 138 AccountsOptions.whitelistIsManaged = function() { |
| 138 return localStrings.getString('whitelist_is_managed') == 'true'; | 139 return loadTimeData.getBoolean('whitelist_is_managed'); |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 /** | 142 /** |
| 142 * Update account picture. | 143 * Update account picture. |
| 143 * @param {string} username User for which to update the image. | 144 * @param {string} username User for which to update the image. |
| 144 */ | 145 */ |
| 145 AccountsOptions.updateAccountPicture = function(username) { | 146 AccountsOptions.updateAccountPicture = function(username) { |
| 146 if (this.showWhitelist_) | 147 if (this.showWhitelist_) |
| 147 $('userList').updateAccountPicture(username); | 148 $('userList').updateAccountPicture(username); |
| 148 }; | 149 }; |
| 149 | 150 |
| 150 // Export | 151 // Export |
| 151 return { | 152 return { |
| 152 AccountsOptions: AccountsOptions | 153 AccountsOptions: AccountsOptions |
| 153 }; | 154 }; |
| 154 | 155 |
| 155 }); | 156 }); |
| OLD | NEW |