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: |
(...skipping 29 matching lines...) Expand all Loading... |
40 * @type {boolean} | 40 * @type {boolean} |
41 */ | 41 */ |
42 disabled: { | 42 disabled: { |
43 type: Boolean, | 43 type: Boolean, |
44 value: false, | 44 value: false, |
45 } | 45 } |
46 }, | 46 }, |
47 | 47 |
48 /** @override */ | 48 /** @override */ |
49 ready: function() { | 49 ready: function() { |
50 chrome.settingsPrivate.onPrefsChanged.addListener(function(prefs) { | 50 chrome.settingsPrivate.onPrefsChanged.addListener(prefs => { |
51 prefs.forEach(function(pref) { | 51 prefs.forEach(function(pref) { |
52 if (pref.key == 'cros.accounts.users') { | 52 if (pref.key == 'cros.accounts.users') { |
53 chrome.usersPrivate.getWhitelistedUsers(function(users) { | 53 chrome.usersPrivate.getWhitelistedUsers(users => { |
54 this.setUsers_(users); | 54 this.setUsers_(users); |
55 }.bind(this)); | 55 }); |
56 } | 56 } |
57 }, this); | 57 }, this); |
58 }.bind(this)); | 58 }); |
59 }, | 59 }, |
60 | 60 |
61 /** @protected */ | 61 /** @protected */ |
62 currentRouteChanged: function() { | 62 currentRouteChanged: function() { |
63 if (settings.getCurrentRoute() == settings.routes.ACCOUNTS) { | 63 if (settings.getCurrentRoute() == settings.routes.ACCOUNTS) { |
64 chrome.usersPrivate.getWhitelistedUsers(function(users) { | 64 chrome.usersPrivate.getWhitelistedUsers(users => { |
65 this.setUsers_(users); | 65 this.setUsers_(users); |
66 }.bind(this)); | 66 }); |
67 } | 67 } |
68 }, | 68 }, |
69 | 69 |
70 /** | 70 /** |
71 * @param {!chrome.usersPrivate.User} user | 71 * @param {!chrome.usersPrivate.User} user |
72 * @return {string} | 72 * @return {string} |
73 * @private | 73 * @private |
74 */ | 74 */ |
75 getUserName_: function(user) { | 75 getUserName_: function(user) { |
76 return user.isOwner ? this.i18n('deviceOwnerLabel', user.name) : user.name; | 76 return user.isOwner ? this.i18n('deviceOwnerLabel', user.name) : user.name; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 }, | 114 }, |
115 | 115 |
116 /** | 116 /** |
117 * @param {chrome.usersPrivate.User} user | 117 * @param {chrome.usersPrivate.User} user |
118 * @private | 118 * @private |
119 */ | 119 */ |
120 shouldShowEmail_: function(user) { | 120 shouldShowEmail_: function(user) { |
121 return !user.isSupervised && user.name != user.displayEmail; | 121 return !user.isSupervised && user.name != user.displayEmail; |
122 }, | 122 }, |
123 }); | 123 }); |
OLD | NEW |