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

Side by Side Diff: chrome/browser/resources/settings/people_page/people_page.js

Issue 2062503002: Settings People Revamp: Add 'Manage Supervised Users' row (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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
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-people-page' is the settings page containing sign-in settings. 7 * 'settings-people-page' is the settings page containing sign-in settings.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-people-page', 10 is: 'settings-people-page',
(...skipping 28 matching lines...) Expand all
39 /** 39 /**
40 * The currently selected profile icon URL. May be a data URL. 40 * The currently selected profile icon URL. May be a data URL.
41 */ 41 */
42 profileIconUrl_: String, 42 profileIconUrl_: String,
43 43
44 /** 44 /**
45 * The current profile name. 45 * The current profile name.
46 */ 46 */
47 profileName_: String, 47 profileName_: String,
48 48
49 /**
50 * True if the current profile manages supervised users.
51 */
52 profileManagesSupervisedUsers_: {
53 type: Boolean,
54 value: false,
hcarmona 2016/06/10 22:58:08 Is the default necessary? This is always set on at
tommycli 2016/06/10 23:28:45 Done.
55 },
56
49 /** @private {!settings.SyncBrowserProxyImpl} */ 57 /** @private {!settings.SyncBrowserProxyImpl} */
50 syncBrowserProxy_: { 58 syncBrowserProxy_: {
51 type: Object, 59 type: Object,
52 value: function() { 60 value: function() {
53 return settings.SyncBrowserProxyImpl.getInstance(); 61 return settings.SyncBrowserProxyImpl.getInstance();
54 }, 62 },
55 }, 63 },
56 64
57 <if expr="chromeos"> 65 <if expr="chromeos">
58 /** 66 /**
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return loadTimeData.getBoolean('easyUnlockAllowed') && 113 return loadTimeData.getBoolean('easyUnlockAllowed') &&
106 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed'); 114 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed');
107 }, 115 },
108 readOnly: true, 116 readOnly: true,
109 }, 117 },
110 </if> 118 </if>
111 }, 119 },
112 120
113 /** @override */ 121 /** @override */
114 attached: function() { 122 attached: function() {
115 settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileInfo().then( 123 var profileInfoProxy = settings.ProfileInfoBrowserProxyImpl.getInstance();
116 this.handleProfileInfo_.bind(this)); 124 profileInfoProxy.getProfileInfo().then(this.handleProfileInfo_.bind(this));
117 this.addWebUIListener('profile-info-changed', 125 this.addWebUIListener('profile-info-changed',
118 this.handleProfileInfo_.bind(this)); 126 this.handleProfileInfo_.bind(this));
119 127
128 profileInfoProxy.getProfileManagesSupervisedUsers().then(
129 this.handleProfileManagesSupervisedUsers_.bind(this));
130 this.addWebUIListener('profile-manages-supervised-users-changed',
131 this.handleProfileManagesSupervisedUsers_.bind(this));
132
120 this.syncBrowserProxy_.getSyncStatus().then( 133 this.syncBrowserProxy_.getSyncStatus().then(
121 this.handleSyncStatus_.bind(this)); 134 this.handleSyncStatus_.bind(this));
122 this.addWebUIListener('sync-status-changed', 135 this.addWebUIListener('sync-status-changed',
123 this.handleSyncStatus_.bind(this)); 136 this.handleSyncStatus_.bind(this));
124 137
125 <if expr="chromeos"> 138 <if expr="chromeos">
126 if (this.easyUnlockAllowed_) { 139 if (this.easyUnlockAllowed_) {
127 this.addWebUIListener( 140 this.addWebUIListener(
128 'easy-unlock-enabled-status', 141 'easy-unlock-enabled-status',
129 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); 142 this.handleEasyUnlockEnabledStatusChanged_.bind(this));
130 this.easyUnlockBrowserProxy_.getEnabledStatus().then( 143 this.easyUnlockBrowserProxy_.getEnabledStatus().then(
131 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); 144 this.handleEasyUnlockEnabledStatusChanged_.bind(this));
132 } 145 }
133 </if> 146 </if>
134 }, 147 },
135 148
136 /** 149 /**
137 * Handler for when the profile's icon and name is updated. 150 * Handler for when the profile's icon and name is updated.
138 * @private 151 * @private
139 * @param {!settings.ProfileInfo} info 152 * @param {!settings.ProfileInfo} info
140 */ 153 */
141 handleProfileInfo_: function(info) { 154 handleProfileInfo_: function(info) {
142 this.profileName_ = info.name; 155 this.profileName_ = info.name;
143 this.profileIconUrl_ = info.iconUrl; 156 this.profileIconUrl_ = info.iconUrl;
144 }, 157 },
145 158
146 /** 159 /**
160 * Handler for when the profile starts or stops managing supervised users.
161 * @private
162 * @param {boolean} managesSupervisedUsers
163 */
164 handleProfileManagesSupervisedUsers_: function(managesSupervisedUsers) {
165 this.profileManagesSupervisedUsers_ = managesSupervisedUsers;
166 },
167
168 /**
147 * Handler for when the sync state is pushed from the browser. 169 * Handler for when the sync state is pushed from the browser.
148 * @param {?settings.SyncStatus} syncStatus 170 * @param {?settings.SyncStatus} syncStatus
149 * @private 171 * @private
150 */ 172 */
151 handleSyncStatus_: function(syncStatus) { 173 handleSyncStatus_: function(syncStatus) {
152 this.syncStatus = syncStatus; 174 this.syncStatus = syncStatus;
153 }, 175 },
154 176
155 <if expr="chromeos"> 177 <if expr="chromeos">
156 /** 178 /**
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 /** @private */ 250 /** @private */
229 onManageOtherPeople_: function() { 251 onManageOtherPeople_: function() {
230 <if expr="not chromeos"> 252 <if expr="not chromeos">
231 this.syncBrowserProxy_.manageOtherPeople(); 253 this.syncBrowserProxy_.manageOtherPeople();
232 </if> 254 </if>
233 <if expr="chromeos"> 255 <if expr="chromeos">
234 this.$.pages.setSubpageChain(['users']); 256 this.$.pages.setSubpageChain(['users']);
235 </if> 257 </if>
236 }, 258 },
237 259
260 /** @private */
261 onManageSupervisedUsers_: function() {
262 window.open(loadTimeData.getString('supervisedUsersUrl'));
263 },
264
238 /** 265 /**
239 * @private 266 * @private
240 * @param {?settings.SyncStatus} syncStatus 267 * @param {?settings.SyncStatus} syncStatus
241 * @return {boolean} 268 * @return {boolean}
242 */ 269 */
243 isAdvancedSyncSettingsVisible_: function(syncStatus) { 270 isAdvancedSyncSettingsVisible_: function(syncStatus) {
244 return !!syncStatus && !!syncStatus.signedIn && 271 return !!syncStatus && !!syncStatus.signedIn &&
245 !!syncStatus.syncSystemEnabled; 272 !!syncStatus.syncSystemEnabled;
246 }, 273 },
247 274
248 /** 275 /**
249 * @private 276 * @private
250 * @param {?settings.SyncStatus} syncStatus 277 * @param {?settings.SyncStatus} syncStatus
251 * @return {string} 278 * @return {string}
252 */ 279 */
253 getSyncIcon_: function(syncStatus) { 280 getSyncIcon_: function(syncStatus) {
254 if (!syncStatus) 281 if (!syncStatus)
255 return ''; 282 return '';
256 if (syncStatus.hasError) 283 if (syncStatus.hasError)
257 return 'settings:sync-problem'; 284 return 'settings:sync-problem';
258 if (syncStatus.managed) 285 if (syncStatus.managed)
259 return 'settings:sync-disabled'; 286 return 'settings:sync-disabled';
260 287
261 return 'settings:done'; 288 return 'settings:done';
262 }, 289 },
263 }); 290 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698