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

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

Issue 1900913002: Settings People Revamp: Split Profile Info out into its own handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 * Example: 9 * Example:
10 * 10 *
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 */ 49 */
50 profileIconUrl_: String, 50 profileIconUrl_: String,
51 51
52 /** 52 /**
53 * The current profile name. 53 * The current profile name.
54 */ 54 */
55 profileName_: String, 55 profileName_: String,
56 56
57 <if expr="chromeos"> 57 <if expr="chromeos">
58 /** @private {!settings.EasyUnlockBrowserProxyImpl} */ 58 /** @private {!settings.EasyUnlockBrowserProxyImpl} */
59 browserProxy_: { 59 easyUnlockBrowserProxy_: {
60 type: Object, 60 type: Object,
61 value: function() { 61 value: function() {
62 return settings.EasyUnlockBrowserProxyImpl.getInstance(); 62 return settings.EasyUnlockBrowserProxyImpl.getInstance();
63 }, 63 },
64 }, 64 },
65 65
66 /** 66 /**
67 * True if Easy Unlock is allowed on this machine. 67 * True if Easy Unlock is allowed on this machine.
68 */ 68 */
69 easyUnlockAllowed_: { 69 easyUnlockAllowed_: {
(...skipping 23 matching lines...) Expand all
93 return loadTimeData.getBoolean('easyUnlockAllowed') && 93 return loadTimeData.getBoolean('easyUnlockAllowed') &&
94 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed'); 94 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed');
95 }, 95 },
96 readOnly: true, 96 readOnly: true,
97 }, 97 },
98 </if> 98 </if>
99 }, 99 },
100 100
101 /** @override */ 101 /** @override */
102 attached: function() { 102 attached: function() {
103 settings.SyncPrivateApi.getProfileInfo(this.handleProfileInfo_.bind(this)); 103 settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileInfo().then(
104 this.handleProfileInfo_.bind(this));
105 this.addWebUIListener('profile-info-changed',
106 this.handleProfileInfo_.bind(this));
107
104 settings.SyncPrivateApi.getSyncStatus( 108 settings.SyncPrivateApi.getSyncStatus(
105 this.handleSyncStatusFetched_.bind(this)); 109 this.handleSyncStatusFetched_.bind(this));
106 110
107 <if expr="chromeos"> 111 <if expr="chromeos">
108 if (this.easyUnlockAllowed_) { 112 if (this.easyUnlockAllowed_) {
109 this.addWebUIListener( 113 this.addWebUIListener(
110 'easy-unlock-enabled-status', 114 'easy-unlock-enabled-status',
111 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); 115 this.handleEasyUnlockEnabledStatusChanged_.bind(this));
112 this.browserProxy_.getEnabledStatus().then( 116 this.easyUnlockBrowserProxy_.getEnabledStatus().then(
113 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); 117 this.handleEasyUnlockEnabledStatusChanged_.bind(this));
114 } 118 }
115 </if> 119 </if>
116 }, 120 },
117 121
118 /** 122 /**
119 * Handler for when the profile's icon and name is updated. 123 * Handler for when the profile's icon and name is updated.
120 * @private 124 * @private
121 * @param {!string} name 125 * @param {!settings.ProfileInfo} info
122 * @param {!string} iconUrl
123 */ 126 */
124 handleProfileInfo_: function(name, iconUrl) { 127 handleProfileInfo_: function(info) {
125 this.profileName_ = name; 128 this.profileName_ = info.name;
126 this.profileIconUrl_ = iconUrl; 129 this.profileIconUrl_ = info.iconUrl;
127 }, 130 },
128 131
129 /** 132 /**
130 * Handler for when the sync state is pushed from settings.SyncPrivateApi. 133 * Handler for when the sync state is pushed from settings.SyncPrivateApi.
131 * @private 134 * @private
132 */ 135 */
133 handleSyncStatusFetched_: function(syncStatus) { 136 handleSyncStatusFetched_: function(syncStatus) {
134 this.syncStatus = syncStatus; 137 this.syncStatus = syncStatus;
135 138
136 // TODO(tommycli): Remove once we figure out how to refactor the sync 139 // TODO(tommycli): Remove once we figure out how to refactor the sync
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 }, 192 },
190 193
191 /** @private */ 194 /** @private */
192 onSyncTap_: function() { 195 onSyncTap_: function() {
193 this.$.pages.setSubpageChain(['sync']); 196 this.$.pages.setSubpageChain(['sync']);
194 }, 197 },
195 198
196 <if expr="chromeos"> 199 <if expr="chromeos">
197 /** @private */ 200 /** @private */
198 onEasyUnlockSetupTap_: function() { 201 onEasyUnlockSetupTap_: function() {
199 this.browserProxy_.startTurnOnFlow(); 202 this.easyUnlockBrowserProxy_.startTurnOnFlow();
200 }, 203 },
201 204
202 /** @private */ 205 /** @private */
203 onEasyUnlockTurnOffTap_: function() { 206 onEasyUnlockTurnOffTap_: function() {
204 this.$$('#easyUnlockTurnOffDialog').open(); 207 this.$$('#easyUnlockTurnOffDialog').open();
205 }, 208 },
206 </if> 209 </if>
207 210
208 /** @private */ 211 /** @private */
209 onManageOtherPeople_: function() { 212 onManageOtherPeople_: function() {
(...skipping 15 matching lines...) Expand all
225 228
226 /** 229 /**
227 * @private 230 * @private
228 * @return {boolean} 231 * @return {boolean}
229 */ 232 */
230 isAdvancedSyncSettingsVisible_: function(syncStatus) { 233 isAdvancedSyncSettingsVisible_: function(syncStatus) {
231 return syncStatus && syncStatus.signedIn && !syncStatus.managed && 234 return syncStatus && syncStatus.signedIn && !syncStatus.managed &&
232 syncStatus.syncSystemEnabled; 235 syncStatus.syncSystemEnabled;
233 }, 236 },
234 }); 237 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698