| 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 * Must be kept in sync with the return values of getSyncErrorAction in |
| 34 * chrome/browser/ui/webui/settings/people_handler.cc |
| 35 * @enum {string} |
| 36 */ |
| 37 settings.StatusAction = { |
| 38 NO_ACTION: 'noAction', // No action to take. |
| 39 REAUTHENTICATE: 'reauthenticate', // User needs to reauthenticate. |
| 40 UPGRADE_CLIENT: 'upgradeClient', // User needs to upgrade the client. |
| 41 ENTER_PASSPHRASE: 'enterPassphrase', // User needs to enter passphrase. |
| 42 }; |
| 43 |
| 31 /** | 44 /** |
| 32 * The state of sync. This is the data structure sent back and forth between | 45 * 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 | 46 * 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. | 47 * require changes to the C++ handler, which is already functional. |
| 35 * @typedef {{ | 48 * @typedef {{ |
| 36 * appsEnforced: boolean, | 49 * appsEnforced: boolean, |
| 37 * appsRegistered: boolean, | 50 * appsRegistered: boolean, |
| 38 * appsSynced: boolean, | 51 * appsSynced: boolean, |
| 39 * autofillEnforced: boolean, | 52 * autofillEnforced: boolean, |
| 40 * autofillRegistered: boolean, | 53 * autofillRegistered: boolean, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 * @param {boolean} deleteProfile | 116 * @param {boolean} deleteProfile |
| 104 */ | 117 */ |
| 105 signOut: function(deleteProfile) {}, | 118 signOut: function(deleteProfile) {}, |
| 106 | 119 |
| 107 /** | 120 /** |
| 108 * Opens the multi-profile user manager. | 121 * Opens the multi-profile user manager. |
| 109 */ | 122 */ |
| 110 manageOtherPeople: function() {}, | 123 manageOtherPeople: function() {}, |
| 111 </if> | 124 </if> |
| 112 | 125 |
| 126 <if expr="chromeos"> |
| 127 /** |
| 128 * Signs the user out. |
| 129 */ |
| 130 attemptUserExit: function() {}, |
| 131 </if> |
| 132 |
| 113 /** | 133 /** |
| 114 * Gets the current sync status. | 134 * Gets the current sync status. |
| 115 * @return {!Promise<!settings.SyncStatus>} | 135 * @return {!Promise<!settings.SyncStatus>} |
| 116 */ | 136 */ |
| 117 getSyncStatus: function() {}, | 137 getSyncStatus: function() {}, |
| 118 | 138 |
| 119 /** | 139 /** |
| 120 * Function to invoke when the sync page has been navigated to. This | 140 * 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 | 141 * 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. | 142 * 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 */ | 189 /** @override */ |
| 170 signOut: function(deleteProfile) { | 190 signOut: function(deleteProfile) { |
| 171 chrome.send('SyncSetupStopSyncing', [deleteProfile]); | 191 chrome.send('SyncSetupStopSyncing', [deleteProfile]); |
| 172 }, | 192 }, |
| 173 | 193 |
| 174 /** @override */ | 194 /** @override */ |
| 175 manageOtherPeople: function() { | 195 manageOtherPeople: function() { |
| 176 chrome.send('SyncSetupManageOtherPeople'); | 196 chrome.send('SyncSetupManageOtherPeople'); |
| 177 }, | 197 }, |
| 178 </if> | 198 </if> |
| 199 <if expr="chromeos"> |
| 200 /** @override */ |
| 201 attemptUserExit: function() { |
| 202 return chrome.send('AttemptUserExit'); |
| 203 }, |
| 204 </if> |
| 179 | 205 |
| 180 /** @override */ | 206 /** @override */ |
| 181 getSyncStatus: function() { | 207 getSyncStatus: function() { |
| 182 return cr.sendWithPromise('SyncSetupGetSyncStatus'); | 208 return cr.sendWithPromise('SyncSetupGetSyncStatus'); |
| 183 }, | 209 }, |
| 184 | 210 |
| 185 /** @override */ | 211 /** @override */ |
| 186 didNavigateToSyncPage: function() { | 212 didNavigateToSyncPage: function() { |
| 187 chrome.send('SyncSetupShowSetupUI'); | 213 chrome.send('SyncSetupShowSetupUI'); |
| 188 }, | 214 }, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 210 'Signin_AccountSettings_GoogleActivityControlsClicked'); | 236 'Signin_AccountSettings_GoogleActivityControlsClicked'); |
| 211 window.open(loadTimeData.getString('activityControlsUrl')); | 237 window.open(loadTimeData.getString('activityControlsUrl')); |
| 212 } | 238 } |
| 213 }; | 239 }; |
| 214 | 240 |
| 215 return { | 241 return { |
| 216 SyncBrowserProxy: SyncBrowserProxy, | 242 SyncBrowserProxy: SyncBrowserProxy, |
| 217 SyncBrowserProxyImpl: SyncBrowserProxyImpl, | 243 SyncBrowserProxyImpl: SyncBrowserProxyImpl, |
| 218 }; | 244 }; |
| 219 }); | 245 }); |
| OLD | NEW |