| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-user-list' shows a list of users whitelisted on this Chrome OS | 7 * 'settings-user-list' shows a list of users whitelisted on this Chrome OS |
| 8 * device. | 8 * device. |
| 9 * | 9 * |
| 10 * Example: | 10 * Example: |
| 11 * | 11 * |
| 12 * <settings-user-list prefs="{{prefs}}"> | 12 * <settings-user-list prefs="{{prefs}}"> |
| 13 * </settings-user-list> | 13 * </settings-user-list> |
| 14 */ | 14 */ |
| 15 Polymer({ | 15 Polymer({ |
| 16 is: 'settings-user-list', | 16 is: 'settings-user-list', |
| 17 | 17 |
| 18 properties: { | 18 properties: { |
| 19 /** | 19 /** |
| 20 * Current list of whitelisted users. | 20 * Current list of whitelisted users. |
| 21 * @type {!Array<!User>} | 21 * @type {!Array<!chrome.usersPrivate.User>} |
| 22 */ | 22 */ |
| 23 users: { | 23 users: { |
| 24 type: Array, | 24 type: Array, |
| 25 value: function() { return []; }, | 25 value: function() { return []; }, |
| 26 notify: true | 26 notify: true |
| 27 }, | 27 }, |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * Whether the user list is disabled, i.e. that no modifications can be | 30 * Whether the user list is disabled, i.e. that no modifications can be |
| 31 * made. | 31 * made. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 49 }, this); | 49 }, this); |
| 50 }.bind(this)); | 50 }.bind(this)); |
| 51 | 51 |
| 52 chrome.usersPrivate.getWhitelistedUsers(function(users) { | 52 chrome.usersPrivate.getWhitelistedUsers(function(users) { |
| 53 this.users = users; | 53 this.users = users; |
| 54 }.bind(this)); | 54 }.bind(this)); |
| 55 }, | 55 }, |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * @private | 58 * @private |
| 59 * @param {!{model: !{item: !User}}} e | 59 * @param {!{model: !{item: !chrome.usersPrivate.User}}} e |
| 60 */ | 60 */ |
| 61 removeUser_: function(e) { | 61 removeUser_: function(e) { |
| 62 chrome.usersPrivate.removeWhitelistedUser( | 62 chrome.usersPrivate.removeWhitelistedUser( |
| 63 e.model.item.email, /* callback */ function() {}); | 63 e.model.item.email, /* callback */ function() {}); |
| 64 }, | 64 }, |
| 65 | 65 |
| 66 /** @private */ | 66 /** @private */ |
| 67 shouldHideCloseButton_: function(disabled, isUserOwner) { | 67 shouldHideCloseButton_: function(disabled, isUserOwner) { |
| 68 return disabled || isUserOwner; | 68 return disabled || isUserOwner; |
| 69 } | 69 } |
| 70 }); | 70 }); |
| OLD | NEW |