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

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

Issue 1806123002: Settings People Revamp: Easy Unlock: Add browser proxy and setup flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 * Example: 9 * Example:
10 * 10 *
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 */ 50 */
51 profileIconUrl_: String, 51 profileIconUrl_: String,
52 52
53 /** 53 /**
54 * The current profile name. 54 * The current profile name.
55 * @private {string} 55 * @private {string}
56 */ 56 */
57 profileName_: String, 57 profileName_: String,
58 58
59 <if expr="chromeos"> 59 <if expr="chromeos">
60 /** @private {!settings.EasyUnlockBrowserProxyImpl} */
61 easyUnlockBrowserProxy_: {
dpapad 2016/03/16 22:17:01 Nit: How about renaming this simply to "browserPro
tommycli 2016/03/17 00:33:26 Done.
62 type: Object,
63 value: function() {
64 return settings.EasyUnlockBrowserProxyImpl.getInstance();
dpapad 2016/03/16 22:17:01 Do you think it would be worth adding unit tests f
tommycli 2016/03/17 00:33:26 Yes, the unit tests are in the very next patch I'm
dpapad 2016/03/17 00:52:23 No need to merge them. I'll review the follow up o
tommycli 2016/03/17 18:38:07 Exactly. The data is retrieved via cr.sendWithProm
65 },
66 },
67
60 /** 68 /**
61 * True if Easy Unlock is allowed on this machine. 69 * True if Easy Unlock is allowed on this machine.
62 * @private {boolean} 70 * @private {boolean}
63 */ 71 */
64 easyUnlockAllowed_: { 72 easyUnlockAllowed_: {
65 type: Boolean, 73 type: Boolean,
66 value: function() { 74 value: function() {
67 return loadTimeData.getBoolean('easyUnlockAllowed'); 75 return loadTimeData.getBoolean('easyUnlockAllowed');
68 }, 76 },
69 readOnly: true, 77 readOnly: true,
(...skipping 16 matching lines...) Expand all
86 attached: function() { 94 attached: function() {
87 settings.SyncPrivateApi.getProfileInfo(this.handleProfileInfo_.bind(this)); 95 settings.SyncPrivateApi.getProfileInfo(this.handleProfileInfo_.bind(this));
88 settings.SyncPrivateApi.getSyncStatus( 96 settings.SyncPrivateApi.getSyncStatus(
89 this.handleSyncStatusFetched_.bind(this)); 97 this.handleSyncStatusFetched_.bind(this));
90 98
91 <if expr="chromeos"> 99 <if expr="chromeos">
92 if (this.easyUnlockAllowed_) { 100 if (this.easyUnlockAllowed_) {
93 this.addWebUIListener( 101 this.addWebUIListener(
94 'easy-unlock-enabled-status', 102 'easy-unlock-enabled-status',
95 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); 103 this.handleEasyUnlockEnabledStatusChanged_.bind(this));
104 this.easyUnlockBrowserProxy_.getEnabledStatus().then(
105 this.handleEasyUnlockEnabledStatusChanged_.bind(this));
96 } 106 }
97 </if> 107 </if>
98 }, 108 },
99 109
100 /** 110 /**
101 * Handler for when the profile's icon and name is updated. 111 * Handler for when the profile's icon and name is updated.
102 * @private 112 * @private
103 * @param {!string} name 113 * @param {!string} name
104 * @param {!string} iconUrl 114 * @param {!string} iconUrl
105 */ 115 */
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 settings.SyncPrivateApi.disconnect(deleteProfile); 178 settings.SyncPrivateApi.disconnect(deleteProfile);
169 179
170 // Dialog automatically closed because button has dialog-confirm attribute. 180 // Dialog automatically closed because button has dialog-confirm attribute.
171 }, 181 },
172 182
173 /** @private */ 183 /** @private */
174 onSyncTap_: function() { 184 onSyncTap_: function() {
175 this.$.pages.setSubpageChain(['sync']); 185 this.$.pages.setSubpageChain(['sync']);
176 }, 186 },
177 187
188 <if expr="chromeos">
189 /** @private */
190 onEasyUnlockSetupTap_: function() {
191 this.easyUnlockBrowserProxy_.launchSetup();
192 },
193
194 /** @private */
195 onEasyUnlockTurnOffTap_: function() {
196 // TODO(tommycli): Implement Easy Unlock turn off functionality.
197 },
198 </if>
199
178 /** @private */ 200 /** @private */
179 onManageOtherPeople_: function() { 201 onManageOtherPeople_: function() {
180 <if expr="not chromeos"> 202 <if expr="not chromeos">
181 settings.SyncPrivateApi.manageOtherPeople(); 203 settings.SyncPrivateApi.manageOtherPeople();
182 </if> 204 </if>
183 <if expr="chromeos"> 205 <if expr="chromeos">
184 this.$.pages.setSubpageChain(['users']); 206 this.$.pages.setSubpageChain(['users']);
185 </if> 207 </if>
186 }, 208 },
187 209
188 /** 210 /**
189 * @private 211 * @private
190 * @return {boolean} 212 * @return {boolean}
191 */ 213 */
192 isStatusTextSet_: function(syncStatus) { 214 isStatusTextSet_: function(syncStatus) {
193 return syncStatus && syncStatus.statusText.length > 0; 215 return syncStatus && syncStatus.statusText.length > 0;
194 }, 216 },
195 217
196 /** 218 /**
197 * @private 219 * @private
198 * @return {boolean} 220 * @return {boolean}
199 */ 221 */
200 isAdvancedSyncSettingsVisible_: function(syncStatus) { 222 isAdvancedSyncSettingsVisible_: function(syncStatus) {
201 return syncStatus && syncStatus.signedIn && !syncStatus.managed && 223 return syncStatus && syncStatus.signedIn && !syncStatus.managed &&
202 syncStatus.syncSystemEnabled; 224 syncStatus.syncSystemEnabled;
203 }, 225 },
204 }); 226 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698