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

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

Issue 2787153002: MD Settings: Move easy unlock from people to lock screen. (Closed)
Patch Set: Fixed patch set 7 errors. Created 3 years, 8 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 * @private 90 * @private
91 */ 91 */
92 quickUnlockEnabled_: { 92 quickUnlockEnabled_: {
93 type: Boolean, 93 type: Boolean,
94 value: function() { 94 value: function() {
95 return loadTimeData.getBoolean('pinUnlockEnabled') || 95 return loadTimeData.getBoolean('pinUnlockEnabled') ||
96 loadTimeData.getBoolean('fingerprintUnlockEnabled'); 96 loadTimeData.getBoolean('fingerprintUnlockEnabled');
97 }, 97 },
98 readOnly: true, 98 readOnly: true,
99 }, 99 },
100
101 /** @private {!settings.EasyUnlockBrowserProxy} */
102 easyUnlockBrowserProxy_: {
103 type: Object,
104 value: function() {
105 return settings.EasyUnlockBrowserProxyImpl.getInstance();
106 },
107 },
108
109 /**
110 * True if Easy Unlock is allowed on this machine.
111 */
112 easyUnlockAllowed_: {
113 type: Boolean,
114 value: function() {
115 return loadTimeData.getBoolean('easyUnlockAllowed');
116 },
117 readOnly: true,
118 },
119
120 /**
121 * True if Easy Unlock is enabled.
122 */
123 easyUnlockEnabled_: {
124 type: Boolean,
125 value: function() {
126 return loadTimeData.getBoolean('easyUnlockEnabled');
127 },
128 },
129
130 /**
131 * True if Easy Unlock's proximity detection feature is allowed.
132 */
133 easyUnlockProximityDetectionAllowed_: {
134 type: Boolean,
135 value: function() {
136 return loadTimeData.getBoolean('easyUnlockAllowed') &&
137 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed');
138 },
139 readOnly: true,
140 },
141
142 /** @private */
143 showEasyUnlockTurnOffDialog_: {
144 type: Boolean,
145 value: false,
146 },
147 // </if> 100 // </if>
148 }, 101 },
149 102
150 /** @override */ 103 /** @override */
151 attached: function() { 104 attached: function() {
152 var profileInfoProxy = settings.ProfileInfoBrowserProxyImpl.getInstance(); 105 var profileInfoProxy = settings.ProfileInfoBrowserProxyImpl.getInstance();
153 profileInfoProxy.getProfileInfo().then(this.handleProfileInfo_.bind(this)); 106 profileInfoProxy.getProfileInfo().then(this.handleProfileInfo_.bind(this));
154 this.addWebUIListener('profile-info-changed', 107 this.addWebUIListener('profile-info-changed',
155 this.handleProfileInfo_.bind(this)); 108 this.handleProfileInfo_.bind(this));
156 109
157 profileInfoProxy.getProfileManagesSupervisedUsers().then( 110 profileInfoProxy.getProfileManagesSupervisedUsers().then(
158 this.handleProfileManagesSupervisedUsers_.bind(this)); 111 this.handleProfileManagesSupervisedUsers_.bind(this));
159 this.addWebUIListener('profile-manages-supervised-users-changed', 112 this.addWebUIListener('profile-manages-supervised-users-changed',
160 this.handleProfileManagesSupervisedUsers_.bind(this)); 113 this.handleProfileManagesSupervisedUsers_.bind(this));
161 114
162 this.addWebUIListener('profile-stats-count-ready', 115 this.addWebUIListener('profile-stats-count-ready',
163 this.handleProfileStatsCount_.bind(this)); 116 this.handleProfileStatsCount_.bind(this));
164 117
165 this.syncBrowserProxy_.getSyncStatus().then( 118 this.syncBrowserProxy_.getSyncStatus().then(
166 this.handleSyncStatus_.bind(this)); 119 this.handleSyncStatus_.bind(this));
167 this.addWebUIListener('sync-status-changed', 120 this.addWebUIListener('sync-status-changed',
168 this.handleSyncStatus_.bind(this)); 121 this.handleSyncStatus_.bind(this));
169
170 // <if expr="chromeos">
171 if (this.easyUnlockAllowed_) {
172 this.addWebUIListener(
173 'easy-unlock-enabled-status',
174 this.handleEasyUnlockEnabledStatusChanged_.bind(this));
175 this.easyUnlockBrowserProxy_.getEnabledStatus().then(
176 this.handleEasyUnlockEnabledStatusChanged_.bind(this));
177 }
178 // </if>
179 }, 122 },
180 123
181 /** @protected */ 124 /** @protected */
182 currentRouteChanged: function() { 125 currentRouteChanged: function() {
183 this.showImportDataDialog_ = 126 this.showImportDataDialog_ =
184 settings.getCurrentRoute() == settings.Route.IMPORT_DATA; 127 settings.getCurrentRoute() == settings.Route.IMPORT_DATA;
185 128
186 if (settings.getCurrentRoute() == settings.Route.SIGN_OUT) { 129 if (settings.getCurrentRoute() == settings.Route.SIGN_OUT) {
187 // If the sync status has not been fetched yet, optimistically display 130 // If the sync status has not been fetched yet, optimistically display
188 // the disconnect dialog. There is another check when the sync status is 131 // the disconnect dialog. There is another check when the sync status is
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 if (syncStatus.signedIn) 202 if (syncStatus.signedIn)
260 settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileStatsCount(); 203 settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileStatsCount();
261 // </if> 204 // </if>
262 205
263 if (!syncStatus.signedIn && this.showDisconnectDialog_) 206 if (!syncStatus.signedIn && this.showDisconnectDialog_)
264 this.$$('#disconnectDialog').close(); 207 this.$$('#disconnectDialog').close();
265 208
266 this.syncStatus = syncStatus; 209 this.syncStatus = syncStatus;
267 }, 210 },
268 211
269 // <if expr="chromeos">
270 /**
271 * Handler for when the Easy Unlock enabled status has changed.
272 * @private
273 */
274 handleEasyUnlockEnabledStatusChanged_: function(easyUnlockEnabled) {
275 this.easyUnlockEnabled_ = easyUnlockEnabled;
276 this.showEasyUnlockTurnOffDialog_ =
277 easyUnlockEnabled && this.showEasyUnlockTurnOffDialog_;
278 },
279 // </if>
280
281 /** @private */ 212 /** @private */
282 onPictureTap_: function() { 213 onPictureTap_: function() {
283 // <if expr="chromeos"> 214 // <if expr="chromeos">
284 settings.navigateTo(settings.Route.CHANGE_PICTURE); 215 settings.navigateTo(settings.Route.CHANGE_PICTURE);
285 // </if> 216 // </if>
286 // <if expr="not chromeos"> 217 // <if expr="not chromeos">
287 settings.navigateTo(settings.Route.MANAGE_PROFILE); 218 settings.navigateTo(settings.Route.MANAGE_PROFILE);
288 // </if> 219 // </if>
289 }, 220 },
290 221
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 default: 302 default:
372 settings.navigateTo(settings.Route.SYNC); 303 settings.navigateTo(settings.Route.SYNC);
373 } 304 }
374 }, 305 },
375 306
376 // <if expr="chromeos"> 307 // <if expr="chromeos">
377 /** @private */ 308 /** @private */
378 onConfigureLockTap_: function() { 309 onConfigureLockTap_: function() {
379 settings.navigateTo(settings.Route.LOCK_SCREEN); 310 settings.navigateTo(settings.Route.LOCK_SCREEN);
380 }, 311 },
381
382 /** @private */
383 onEasyUnlockSetupTap_: function() {
384 this.easyUnlockBrowserProxy_.startTurnOnFlow();
385 },
386
387 /**
388 * @param {!Event} e
389 * @private
390 */
391 onEasyUnlockTurnOffTap_: function(e) {
392 e.preventDefault();
393 this.showEasyUnlockTurnOffDialog_ = true;
394 },
395
396 /** @private */
397 onEasyUnlockTurnOffDialogClose_: function() {
398 this.showEasyUnlockTurnOffDialog_ = false;
399 },
400 // </if> 312 // </if>
401 313
402 /** @private */ 314 /** @private */
403 onManageOtherPeople_: function() { 315 onManageOtherPeople_: function() {
404 // <if expr="not chromeos"> 316 // <if expr="not chromeos">
405 this.syncBrowserProxy_.manageOtherPeople(); 317 this.syncBrowserProxy_.manageOtherPeople();
406 // </if> 318 // </if>
407 // <if expr="chromeos"> 319 // <if expr="chromeos">
408 settings.navigateTo(settings.Route.ACCOUNTS); 320 settings.navigateTo(settings.Route.ACCOUNTS);
409 // </if> 321 // </if>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 429
518 /** 430 /**
519 * @param {!settings.SyncStatus} syncStatus 431 * @param {!settings.SyncStatus} syncStatus
520 * @return {boolean} Whether to show the "Sign in to Chrome" button. 432 * @return {boolean} Whether to show the "Sign in to Chrome" button.
521 * @private 433 * @private
522 */ 434 */
523 showSignin_: function(syncStatus) { 435 showSignin_: function(syncStatus) {
524 return !!syncStatus.signinAllowed && !syncStatus.signedIn; 436 return !!syncStatus.signinAllowed && !syncStatus.signedIn;
525 }, 437 },
526 }); 438 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698