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'); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 TIMEOUT: 'timeout', // Preferences loading has timed out. | 98 TIMEOUT: 'timeout', // Preferences loading has timed out. |
99 DONE: 'done', // Sync subpage can be closed now. | 99 DONE: 'done', // Sync subpage can be closed now. |
100 PASSPHRASE_FAILED: 'passphraseFailed', // Error in the passphrase. | 100 PASSPHRASE_FAILED: 'passphraseFailed', // Error in the passphrase. |
101 }; | 101 }; |
102 | 102 |
103 cr.define('settings', function() { | 103 cr.define('settings', function() { |
104 /** @interface */ | 104 /** @interface */ |
105 function SyncBrowserProxy() {} | 105 function SyncBrowserProxy() {} |
106 | 106 |
107 SyncBrowserProxy.prototype = { | 107 SyncBrowserProxy.prototype = { |
108 <if expr="not chromeos"> | 108 // <if expr="not chromeos"> |
109 /** | 109 /** |
110 * Starts the signin process for the user. Does nothing if the user is | 110 * Starts the signin process for the user. Does nothing if the user is |
111 * already signed in. | 111 * already signed in. |
112 */ | 112 */ |
113 startSignIn: function() {}, | 113 startSignIn: function() {}, |
114 | 114 |
115 /** | 115 /** |
116 * Signs out the signed-in user. | 116 * Signs out the signed-in user. |
117 * @param {boolean} deleteProfile | 117 * @param {boolean} deleteProfile |
118 */ | 118 */ |
119 signOut: function(deleteProfile) {}, | 119 signOut: function(deleteProfile) {}, |
120 | 120 |
121 /** | 121 /** |
122 * Opens the multi-profile user manager. | 122 * Opens the multi-profile user manager. |
123 */ | 123 */ |
124 manageOtherPeople: function() {}, | 124 manageOtherPeople: function() {}, |
125 </if> | 125 // </if> |
126 | 126 |
127 <if expr="chromeos"> | 127 // <if expr="chromeos"> |
128 /** | 128 /** |
129 * Signs the user out. | 129 * Signs the user out. |
130 */ | 130 */ |
131 attemptUserExit: function() {}, | 131 attemptUserExit: function() {}, |
132 </if> | 132 // </if> |
133 | 133 |
134 /** | 134 /** |
135 * Gets the current sync status. | 135 * Gets the current sync status. |
136 * @return {!Promise<!settings.SyncStatus>} | 136 * @return {!Promise<!settings.SyncStatus>} |
137 */ | 137 */ |
138 getSyncStatus: function() {}, | 138 getSyncStatus: function() {}, |
139 | 139 |
140 /** | 140 /** |
141 * Function to invoke when the sync page has been navigated to. This | 141 * Function to invoke when the sync page has been navigated to. This |
142 * registers the UI as the "active" sync UI so that if the user tries to | 142 * registers the UI as the "active" sync UI so that if the user tries to |
(...skipping 28 matching lines...) Expand all Loading... |
171 }; | 171 }; |
172 | 172 |
173 /** | 173 /** |
174 * @constructor | 174 * @constructor |
175 * @implements {settings.SyncBrowserProxy} | 175 * @implements {settings.SyncBrowserProxy} |
176 */ | 176 */ |
177 function SyncBrowserProxyImpl() {} | 177 function SyncBrowserProxyImpl() {} |
178 cr.addSingletonGetter(SyncBrowserProxyImpl); | 178 cr.addSingletonGetter(SyncBrowserProxyImpl); |
179 | 179 |
180 SyncBrowserProxyImpl.prototype = { | 180 SyncBrowserProxyImpl.prototype = { |
181 <if expr="not chromeos"> | 181 // <if expr="not chromeos"> |
182 /** @override */ | 182 /** @override */ |
183 startSignIn: function() { | 183 startSignIn: function() { |
184 chrome.send('SyncSetupStartSignIn'); | 184 chrome.send('SyncSetupStartSignIn'); |
185 }, | 185 }, |
186 | 186 |
187 /** @override */ | 187 /** @override */ |
188 signOut: function(deleteProfile) { | 188 signOut: function(deleteProfile) { |
189 chrome.send('SyncSetupStopSyncing', [deleteProfile]); | 189 chrome.send('SyncSetupStopSyncing', [deleteProfile]); |
190 }, | 190 }, |
191 | 191 |
192 /** @override */ | 192 /** @override */ |
193 manageOtherPeople: function() { | 193 manageOtherPeople: function() { |
194 chrome.send('SyncSetupManageOtherPeople'); | 194 chrome.send('SyncSetupManageOtherPeople'); |
195 }, | 195 }, |
196 </if> | 196 // </if> |
197 <if expr="chromeos"> | 197 // <if expr="chromeos"> |
198 /** @override */ | 198 /** @override */ |
199 attemptUserExit: function() { | 199 attemptUserExit: function() { |
200 return chrome.send('AttemptUserExit'); | 200 return chrome.send('AttemptUserExit'); |
201 }, | 201 }, |
202 </if> | 202 // </if> |
203 | 203 |
204 /** @override */ | 204 /** @override */ |
205 getSyncStatus: function() { | 205 getSyncStatus: function() { |
206 return cr.sendWithPromise('SyncSetupGetSyncStatus'); | 206 return cr.sendWithPromise('SyncSetupGetSyncStatus'); |
207 }, | 207 }, |
208 | 208 |
209 /** @override */ | 209 /** @override */ |
210 didNavigateToSyncPage: function() { | 210 didNavigateToSyncPage: function() { |
211 chrome.send('SyncSetupShowSetupUI'); | 211 chrome.send('SyncSetupShowSetupUI'); |
212 }, | 212 }, |
(...skipping 21 matching lines...) Expand all Loading... |
234 'Signin_AccountSettings_GoogleActivityControlsClicked'); | 234 'Signin_AccountSettings_GoogleActivityControlsClicked'); |
235 window.open(loadTimeData.getString('activityControlsUrl')); | 235 window.open(loadTimeData.getString('activityControlsUrl')); |
236 } | 236 } |
237 }; | 237 }; |
238 | 238 |
239 return { | 239 return { |
240 SyncBrowserProxy: SyncBrowserProxy, | 240 SyncBrowserProxy: SyncBrowserProxy, |
241 SyncBrowserProxyImpl: SyncBrowserProxyImpl, | 241 SyncBrowserProxyImpl: SyncBrowserProxyImpl, |
242 }; | 242 }; |
243 }); | 243 }); |
OLD | NEW |