Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: chrome/browser/resources/settings/users_page/user_list.js

Issue 1503403004: Settings People Rewrite: Move users_page as subpage of People. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0053-people-rename-a-bunch-of-stuff
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview
7 * 'settings-user-list' shows a list of users whitelisted on this Chrome OS
8 * device.
9 *
10 * Example:
11 *
12 * <settings-user-list prefs="{{prefs}}">
13 * </settings-user-list>
14 *
15 * @group Chrome Settings Elements
16 * @element settings-user-list
17 */
18 Polymer({
19 is: 'settings-user-list',
20
21 properties: {
22 /**
23 * Current list of whitelisted users.
24 * @type {!Array<!User>}
25 */
26 users: {
27 type: Array,
28 value: function() { return []; },
29 notify: true
30 },
31
32 /**
33 * Whether the user list is disabled, i.e. that no modifications can be
34 * made.
35 * @type {boolean}
36 */
37 disabled: {
38 type: Boolean,
39 value: false
40 }
41 },
42
43 /** @override */
44 ready: function() {
45 chrome.settingsPrivate.onPrefsChanged.addListener(function(prefs) {
46 prefs.forEach(function(pref) {
47 if (pref.key == 'cros.accounts.users') {
48 chrome.usersPrivate.getWhitelistedUsers(function(users) {
49 this.users = users;
50 }.bind(this));
51 }
52 }, this);
53 }.bind(this));
54
55 chrome.usersPrivate.getWhitelistedUsers(function(users) {
56 this.users = users;
57 }.bind(this));
58 },
59
60 /** @private */
61 removeUser_: function(e) {
62 chrome.usersPrivate.removeWhitelistedUser(
63 e.model.item.email, /* callback */ function() {});
64 },
65
66 /** @private */
67 shouldHideCloseButton_: function(disabled, isUserOwner) {
68 return disabled || isUserOwner;
69 }
70 });
71
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698