blob: dae00f5ba9cf20e030192ffe05edb7204530fe45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview
* 'cr-settings-user-list' shows a list of users whitelisted on this Chrome OS
* device.
*
* Example:
*
* <cr-settings-user-list prefs="{{prefs}}">
* </cr-settings-user-list>
*
* @group Chrome Settings Elements
* @element cr-settings-user-list
*/
Polymer({
is: 'cr-settings-user-list',
properties: {
/**
* Current list of whitelisted users.
* @type {!Array<!User>}
*/
users: {
type: Array,
value: function() { return []; },
notify: true
},
/**
* Whether the user list is disabled, i.e. that no modifications can be
* made.
* @type {boolean}
*/
disabled: {
type: Boolean,
value: false
}
},
/** @override */
ready: function() {
chrome.settingsPrivate.onPrefsChanged.addListener(function(prefs) {
prefs.forEach(function(pref) {
if (pref.key == 'cros.accounts.users') {
chrome.usersPrivate.getWhitelistedUsers(function(users) {
this.users = users;
}.bind(this));
}
}, this);
}.bind(this));
chrome.usersPrivate.getWhitelistedUsers(function(users) {
this.users = users;
}.bind(this));
},
/** @private */
removeUser_: function(e) {
chrome.usersPrivate.removeWhitelistedUser(
e.model.item.email, /* callback */ function() {});
},
/** @private */
shouldHideCloseButton_: function(disabled, isUserOwner) {
return disabled || isUserOwner;
}
});
|