Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 A helper object used from the the People section to get the | 6 * @fileoverview A helper object used from the the People section to get the |
| 7 * status of the sync backend and user preferences on what data to sync. Used | 7 * status of the sync backend and user preferences on what data to sync. Used |
| 8 * for both Chrome browser and ChromeOS. | 8 * for both Chrome browser and ChromeOS. |
| 9 */ | 9 */ |
| 10 cr.exportPath('settings'); | 10 cr.exportPath('settings'); |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * @typedef {{actionLinkText: (string|undefined), | 13 * @typedef {{childUser: (boolean|undefined), |
| 14 * childUser: (boolean|undefined), | |
| 15 * domain: (string|undefined), | 14 * domain: (string|undefined), |
| 16 * hasError: (boolean|undefined), | 15 * hasError: (boolean|undefined), |
| 17 * hasUnrecoverableError: (boolean|undefined), | 16 * hasUnrecoverableError: (boolean|undefined), |
| 18 * managed: (boolean|undefined), | 17 * managed: (boolean|undefined), |
| 19 * setupCompleted: (boolean|undefined), | 18 * setupCompleted: (boolean|undefined), |
| 20 * setupInProgress: (boolean|undefined), | 19 * setupInProgress: (boolean|undefined), |
| 21 * signedIn: (boolean|undefined), | 20 * signedIn: (boolean|undefined), |
| 22 * signedInUsername: (string|undefined), | 21 * signedInUsername: (string|undefined), |
| 23 * signinAllowed: (boolean|undefined), | 22 * signinAllowed: (boolean|undefined), |
| 23 * statusAction: (!settings.StatusAction), | |
| 24 * statusText: (string|undefined), | 24 * statusText: (string|undefined), |
| 25 * supervisedUser: (boolean|undefined), | 25 * supervisedUser: (boolean|undefined), |
| 26 * syncSystemEnabled: (boolean|undefined)}} | 26 * syncSystemEnabled: (boolean|undefined)}} |
| 27 * @see chrome/browser/ui/webui/settings/people_handler.cc | 27 * @see chrome/browser/ui/webui/settings/people_handler.cc |
| 28 */ | 28 */ |
| 29 settings.SyncStatus; | 29 settings.SyncStatus; |
| 30 | 30 |
| 31 | |
| 32 /** | |
| 33 * @enum {string} | |
| 34 */ | |
| 35 settings.StatusAction = { | |
|
tommycli
2016/10/28 21:21:09
Add a note that this must be kept in sync with the
Moe
2016/11/01 19:44:01
Done.
| |
| 36 NO_ACTION: 'noAction', // No action to take. | |
| 37 REAUTHENTICATE: 'reauthenticate', // User needs to reauthenticate. | |
| 38 UPGRADE_CLIENT: 'upgradeClient', // User needs to upgrade the client. | |
| 39 ENTER_PASSPHRASE: 'enterPassphrase', // User needs to enter passphrase. | |
| 40 }; | |
| 41 | |
| 31 /** | 42 /** |
| 32 * The state of sync. This is the data structure sent back and forth between | 43 * The state of sync. This is the data structure sent back and forth between |
| 33 * C++ and JS. Its naming and structure is not optimal, but changing it would | 44 * C++ and JS. Its naming and structure is not optimal, but changing it would |
| 34 * require changes to the C++ handler, which is already functional. | 45 * require changes to the C++ handler, which is already functional. |
| 35 * @typedef {{ | 46 * @typedef {{ |
| 36 * appsEnforced: boolean, | 47 * appsEnforced: boolean, |
| 37 * appsRegistered: boolean, | 48 * appsRegistered: boolean, |
| 38 * appsSynced: boolean, | 49 * appsSynced: boolean, |
| 39 * autofillEnforced: boolean, | 50 * autofillEnforced: boolean, |
| 40 * autofillRegistered: boolean, | 51 * autofillRegistered: boolean, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 * @param {boolean} deleteProfile | 114 * @param {boolean} deleteProfile |
| 104 */ | 115 */ |
| 105 signOut: function(deleteProfile) {}, | 116 signOut: function(deleteProfile) {}, |
| 106 | 117 |
| 107 /** | 118 /** |
| 108 * Opens the multi-profile user manager. | 119 * Opens the multi-profile user manager. |
| 109 */ | 120 */ |
| 110 manageOtherPeople: function() {}, | 121 manageOtherPeople: function() {}, |
| 111 </if> | 122 </if> |
| 112 | 123 |
| 124 <if expr="chromeos"> | |
| 125 /** | |
| 126 * Signs the user out. | |
| 127 */ | |
| 128 attemptUserExit: function() {}, | |
| 129 </if> | |
| 130 | |
| 113 /** | 131 /** |
| 114 * Gets the current sync status. | 132 * Gets the current sync status. |
| 115 * @return {!Promise<!settings.SyncStatus>} | 133 * @return {!Promise<!settings.SyncStatus>} |
| 116 */ | 134 */ |
| 117 getSyncStatus: function() {}, | 135 getSyncStatus: function() {}, |
| 118 | 136 |
| 119 /** | 137 /** |
| 120 * Function to invoke when the sync page has been navigated to. This | 138 * Function to invoke when the sync page has been navigated to. This |
| 121 * registers the UI as the "active" sync UI so that if the user tries to | 139 * registers the UI as the "active" sync UI so that if the user tries to |
| 122 * open another sync UI, this one will be shown instead. | 140 * open another sync UI, this one will be shown instead. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 /** @override */ | 187 /** @override */ |
| 170 signOut: function(deleteProfile) { | 188 signOut: function(deleteProfile) { |
| 171 chrome.send('SyncSetupStopSyncing', [deleteProfile]); | 189 chrome.send('SyncSetupStopSyncing', [deleteProfile]); |
| 172 }, | 190 }, |
| 173 | 191 |
| 174 /** @override */ | 192 /** @override */ |
| 175 manageOtherPeople: function() { | 193 manageOtherPeople: function() { |
| 176 chrome.send('SyncSetupManageOtherPeople'); | 194 chrome.send('SyncSetupManageOtherPeople'); |
| 177 }, | 195 }, |
| 178 </if> | 196 </if> |
| 197 <if expr="chromeos"> | |
| 198 /** @override */ | |
| 199 attemptUserExit: function() { | |
| 200 return chrome.send('AttemptUserExit'); | |
| 201 }, | |
| 202 </if> | |
| 179 | 203 |
| 180 /** @override */ | 204 /** @override */ |
| 181 getSyncStatus: function() { | 205 getSyncStatus: function() { |
| 182 return cr.sendWithPromise('SyncSetupGetSyncStatus'); | 206 return cr.sendWithPromise('SyncSetupGetSyncStatus'); |
| 183 }, | 207 }, |
| 184 | 208 |
| 185 /** @override */ | 209 /** @override */ |
| 186 didNavigateToSyncPage: function() { | 210 didNavigateToSyncPage: function() { |
| 187 chrome.send('SyncSetupShowSetupUI'); | 211 chrome.send('SyncSetupShowSetupUI'); |
| 188 }, | 212 }, |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 210 'Signin_AccountSettings_GoogleActivityControlsClicked'); | 234 'Signin_AccountSettings_GoogleActivityControlsClicked'); |
| 211 window.open(loadTimeData.getString('activityControlsUrl')); | 235 window.open(loadTimeData.getString('activityControlsUrl')); |
| 212 } | 236 } |
| 213 }; | 237 }; |
| 214 | 238 |
| 215 return { | 239 return { |
| 216 SyncBrowserProxy: SyncBrowserProxy, | 240 SyncBrowserProxy: SyncBrowserProxy, |
| 217 SyncBrowserProxyImpl: SyncBrowserProxyImpl, | 241 SyncBrowserProxyImpl: SyncBrowserProxyImpl, |
| 218 }; | 242 }; |
| 219 }); | 243 }); |
| OLD | NEW |