OLD | NEW |
---|---|
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 * |
11 * <iron-animated-pages> | 11 * <iron-animated-pages> |
12 * <settings-people-page prefs="{{prefs}}"></settings-people-page> | 12 * <settings-people-page prefs="{{prefs}}"></settings-people-page> |
13 * ... other pages ... | 13 * ... other pages ... |
14 * </iron-animated-pages> | 14 * </iron-animated-pages> |
15 */ | 15 */ |
16 Polymer({ | 16 Polymer({ |
17 is: 'settings-people-page', | 17 is: 'settings-people-page', |
18 | 18 |
19 behaviors: [ | 19 behaviors: [ |
20 I18nBehavior, | 20 I18nBehavior, |
21 WebUIListenerBehavior, | |
21 ], | 22 ], |
22 | 23 |
23 properties: { | 24 properties: { |
24 /** | 25 /** |
25 * The current active route. | 26 * The current active route. |
26 */ | 27 */ |
27 currentRoute: { | 28 currentRoute: { |
28 type: Object, | 29 type: Object, |
29 notify: true, | 30 notify: true, |
30 }, | 31 }, |
(...skipping 16 matching lines...) Expand all Loading... | |
47 * The currently selected profile icon URL. May be a data URL. | 48 * The currently selected profile icon URL. May be a data URL. |
48 * @private {string} | 49 * @private {string} |
49 */ | 50 */ |
50 profileIconUrl_: String, | 51 profileIconUrl_: String, |
51 | 52 |
52 /** | 53 /** |
53 * The current profile name. | 54 * The current profile name. |
54 * @private {string} | 55 * @private {string} |
55 */ | 56 */ |
56 profileName_: String, | 57 profileName_: String, |
58 | |
59 <if expr="chromeos"> | |
60 /** | |
61 * True if Easy Unlock is allowed on this machine. | |
62 * @private {boolean} | |
63 */ | |
64 easyUnlockAllowed_: { | |
dpapad
2016/03/15 00:44:27
Nit: Does the value of this ever change? If not, s
tommycli
2016/03/15 18:58:27
Done.
| |
65 type: Boolean, | |
66 value: function() { | |
67 return loadTimeData.getBoolean('easyUnlockAllowed'); | |
68 }, | |
69 }, | |
70 | |
71 /** | |
72 * True if Easy Unlock is enabled. | |
73 * @private {boolean} | |
74 */ | |
75 easyUnlockEnabled_: { | |
76 type: Boolean, | |
77 value: function() { | |
78 return loadTimeData.getBoolean('easyUnlockEnabled'); | |
79 }, | |
80 }, | |
81 </if> | |
57 }, | 82 }, |
58 | 83 |
59 /** @override */ | 84 /** @override */ |
60 created: function() { | 85 attached: function() { |
61 settings.SyncPrivateApi.getProfileInfo(this.handleProfileInfo_.bind(this)); | 86 settings.SyncPrivateApi.getProfileInfo(this.handleProfileInfo_.bind(this)); |
62 settings.SyncPrivateApi.getSyncStatus( | 87 settings.SyncPrivateApi.getSyncStatus( |
63 this.handleSyncStatusFetched_.bind(this)); | 88 this.handleSyncStatusFetched_.bind(this)); |
89 | |
90 <if expr="chromeos"> | |
91 this.addWebUIListener( | |
dpapad
2016/03/15 00:44:27
IIUC, this is listener is not needed if easyUnlock
tommycli
2016/03/15 18:58:27
Done.
| |
92 'easy-unlock-enabled-status', | |
93 this.handleEasyUnlockEnabledStatusChanged_.bind(this)); | |
dpapad
2016/03/15 00:44:27
Nit (optional): Given that handleEasyUnlockEnabled
tommycli
2016/03/15 18:58:27
I should have mentioned: I will also be doing a cr
| |
94 </if> | |
64 }, | 95 }, |
65 | 96 |
66 /** | 97 /** |
67 * Handler for when the profile's icon and name is updated. | 98 * Handler for when the profile's icon and name is updated. |
68 * @private | 99 * @private |
69 * @param {!string} name | 100 * @param {!string} name |
70 * @param {!string} iconUrl | 101 * @param {!string} iconUrl |
71 */ | 102 */ |
72 handleProfileInfo_: function(name, iconUrl) { | 103 handleProfileInfo_: function(name, iconUrl) { |
73 this.profileName_ = name; | 104 this.profileName_ = name; |
74 this.profileIconUrl_ = iconUrl; | 105 this.profileIconUrl_ = iconUrl; |
75 }, | 106 }, |
76 | 107 |
77 /** | 108 /** |
78 * Handler for when the sync state is pushed from settings.SyncPrivateApi. | 109 * Handler for when the sync state is pushed from settings.SyncPrivateApi. |
79 * @private | 110 * @private |
80 */ | 111 */ |
81 handleSyncStatusFetched_: function(syncStatus) { | 112 handleSyncStatusFetched_: function(syncStatus) { |
82 this.syncStatus = syncStatus; | 113 this.syncStatus = syncStatus; |
83 | 114 |
84 // TODO(tommycli): Remove once we figure out how to refactor the sync | 115 // TODO(tommycli): Remove once we figure out how to refactor the sync |
85 // code to not include HTML in the status messages. | 116 // code to not include HTML in the status messages. |
86 this.$.syncStatusText.innerHTML = syncStatus.statusText; | 117 this.$.syncStatusText.innerHTML = syncStatus.statusText; |
87 }, | 118 }, |
88 | 119 |
120 <if expr="chromeos"> | |
121 /** | |
122 * Handler for when the Easy Unlock enabled status has changed. | |
123 * @private | |
124 */ | |
125 handleEasyUnlockEnabledStatusChanged_: function(easyUnlockEnabled) { | |
126 this.easyUnlockEnabled_ = easyUnlockEnabled; | |
127 }, | |
128 </if> | |
129 | |
89 /** @private */ | 130 /** @private */ |
90 onActionLinkTap_: function() { | 131 onActionLinkTap_: function() { |
91 settings.SyncPrivateApi.showSetupUI(); | 132 settings.SyncPrivateApi.showSetupUI(); |
92 }, | 133 }, |
93 | 134 |
94 /** @private */ | 135 /** @private */ |
95 onPictureTap_: function() { | 136 onPictureTap_: function() { |
96 <if expr="chromeos"> | 137 <if expr="chromeos"> |
97 this.$.pages.setSubpageChain(['changePicture']); | 138 this.$.pages.setSubpageChain(['changePicture']); |
98 </if> | 139 </if> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 | 192 |
152 /** | 193 /** |
153 * @private | 194 * @private |
154 * @return {boolean} | 195 * @return {boolean} |
155 */ | 196 */ |
156 isAdvancedSyncSettingsVisible_: function(syncStatus) { | 197 isAdvancedSyncSettingsVisible_: function(syncStatus) { |
157 return syncStatus && syncStatus.signedIn && !syncStatus.managed && | 198 return syncStatus && syncStatus.signedIn && !syncStatus.managed && |
158 syncStatus.syncSystemEnabled; | 199 syncStatus.syncSystemEnabled; |
159 }, | 200 }, |
160 }); | 201 }); |
OLD | NEW |