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

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

Issue 2603283003: [MD Settings][People] Force sign out only in the case of unrecoverable error (Closed)
Patch Set: Created 3 years, 11 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 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');
(...skipping 17 matching lines...) Expand all
28 */ 28 */
29 settings.SyncStatus; 29 settings.SyncStatus;
30 30
31 31
32 /** 32 /**
33 * Must be kept in sync with the return values of getSyncErrorAction in 33 * Must be kept in sync with the return values of getSyncErrorAction in
34 * chrome/browser/ui/webui/settings/people_handler.cc 34 * chrome/browser/ui/webui/settings/people_handler.cc
35 * @enum {string} 35 * @enum {string}
36 */ 36 */
37 settings.StatusAction = { 37 settings.StatusAction = {
38 NO_ACTION: 'noAction', // No action to take. 38 NO_ACTION: 'noAction', // No action to take.
39 REAUTHENTICATE: 'reauthenticate', // User needs to reauthenticate. 39 REAUTHENTICATE: 'reauthenticate', // User needs to reauthenticate.
40 UPGRADE_CLIENT: 'upgradeClient', // User needs to upgrade the client. 40 SIGNOUT_AND_SIGNIN: 'signOutAndSignIn', // User needs to sign out and sign in.
41 ENTER_PASSPHRASE: 'enterPassphrase', // User needs to enter passphrase. 41 UPGRADE_CLIENT: 'upgradeClient', // User needs to upgrade the client.
42 ENTER_PASSPHRASE: 'enterPassphrase', // User needs to enter passphrase.
42 }; 43 };
43 44
44 /** 45 /**
45 * The state of sync. This is the data structure sent back and forth between 46 * The state of sync. This is the data structure sent back and forth between
46 * C++ and JS. Its naming and structure is not optimal, but changing it would 47 * C++ and JS. Its naming and structure is not optimal, but changing it would
47 * require changes to the C++ handler, which is already functional. 48 * require changes to the C++ handler, which is already functional.
48 * @typedef {{ 49 * @typedef {{
49 * appsEnforced: boolean, 50 * appsEnforced: boolean,
50 * appsRegistered: boolean, 51 * appsRegistered: boolean,
51 * appsSynced: boolean, 52 * appsSynced: boolean,
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 * @constructor 174 * @constructor
174 * @implements {settings.SyncBrowserProxy} 175 * @implements {settings.SyncBrowserProxy}
175 */ 176 */
176 function SyncBrowserProxyImpl() {} 177 function SyncBrowserProxyImpl() {}
177 cr.addSingletonGetter(SyncBrowserProxyImpl); 178 cr.addSingletonGetter(SyncBrowserProxyImpl);
178 179
179 SyncBrowserProxyImpl.prototype = { 180 SyncBrowserProxyImpl.prototype = {
180 <if expr="not chromeos"> 181 <if expr="not chromeos">
181 /** @override */ 182 /** @override */
182 startSignIn: function() { 183 startSignIn: function() {
183 // TODO(tommycli): Currently this is always false, but this will become 184 chrome.send('SyncSetupStartSignIn');
184 // a parameter once supervised users are implemented in MD Settings.
185 var creatingSupervisedUser = false;
186 chrome.send('SyncSetupStartSignIn', [creatingSupervisedUser]);
187 }, 185 },
188 186
189 /** @override */ 187 /** @override */
190 signOut: function(deleteProfile) { 188 signOut: function(deleteProfile) {
191 chrome.send('SyncSetupStopSyncing', [deleteProfile]); 189 chrome.send('SyncSetupStopSyncing', [deleteProfile]);
192 }, 190 },
193 191
194 /** @override */ 192 /** @override */
195 manageOtherPeople: function() { 193 manageOtherPeople: function() {
196 chrome.send('SyncSetupManageOtherPeople'); 194 chrome.send('SyncSetupManageOtherPeople');
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 'Signin_AccountSettings_GoogleActivityControlsClicked'); 234 'Signin_AccountSettings_GoogleActivityControlsClicked');
237 window.open(loadTimeData.getString('activityControlsUrl')); 235 window.open(loadTimeData.getString('activityControlsUrl'));
238 } 236 }
239 }; 237 };
240 238
241 return { 239 return {
242 SyncBrowserProxy: SyncBrowserProxy, 240 SyncBrowserProxy: SyncBrowserProxy,
243 SyncBrowserProxyImpl: SyncBrowserProxyImpl, 241 SyncBrowserProxyImpl: SyncBrowserProxyImpl,
244 }; 242 };
245 }); 243 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/people_page/people_page.js ('k') | chrome/browser/sync/sync_ui_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698