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

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

Issue 2102803002: Settings People Revamp: Add special Disconnect logic for domain profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make behavior same as Options Created 4 years, 5 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 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 Polymer({ 9 Polymer({
10 is: 'settings-people-page', 10 is: 'settings-people-page',
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 this.syncBrowserProxy_.startSignIn(); 208 this.syncBrowserProxy_.startSignIn();
209 }, 209 },
210 210
211 /** @private */ 211 /** @private */
212 onDisconnectTap_: function() { 212 onDisconnectTap_: function() {
213 this.$.disconnectDialog.open(); 213 this.$.disconnectDialog.open();
214 }, 214 },
215 215
216 /** @private */ 216 /** @private */
217 onDisconnectConfirm_: function() { 217 onDisconnectConfirm_: function() {
218 var deleteProfile = this.$.deleteProfile && this.$.deleteProfile.checked; 218 var deleteProfile = !!this.syncStatus.domain ||
219 this.syncBrowserProxy_.signOut(deleteProfile); 219 (this.$.deleteProfile && this.$.deleteProfile.checked);
220 this.syncBrowserProxy_.signOut(deleteProfile, !!this.syncStatus.domain);
220 221
221 // Dialog automatically closed because button has dialog-confirm attribute. 222 // Dialog automatically closed because button has dialog-confirm attribute.
222 }, 223 },
223 224
224 /** @private */ 225 /** @private */
225 onSyncTap_: function() { 226 onSyncTap_: function() {
226 assert(this.syncStatus.signedIn); 227 assert(this.syncStatus.signedIn);
227 assert(this.syncStatus.syncSystemEnabled); 228 assert(this.syncStatus.syncSystemEnabled);
228 229
229 if (this.syncStatus.managed) 230 if (this.syncStatus.managed)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 */ 268 */
268 getDomainHtml_: function(domain) { 269 getDomainHtml_: function(domain) {
269 var innerSpan = 270 var innerSpan =
270 '<span id="managed-by-domain-name">' + domain + '</span>'; 271 '<span id="managed-by-domain-name">' + domain + '</span>';
271 return loadTimeData.getStringF('domainManagedProfile', innerSpan); 272 return loadTimeData.getStringF('domainManagedProfile', innerSpan);
272 }, 273 },
273 </if> 274 </if>
274 275
275 /** 276 /**
276 * @private 277 * @private
278 * @param {string} domain
279 * @return {string}
280 */
281 getDisconnectExplanationHtml_: function(domain) {
282 <if expr="not chromeos">
283 if (domain) {
284 return loadTimeData.getStringF(
285 'syncDisconnectManagedProfileExplanation',
286 '<span id="managed-by-domain-name">' + domain + '</span>');
287 }
288 </if>
289 return loadTimeData.getString('syncDisconnectExplanation');
290 },
291
292 /**
293 * @private
277 * @param {?settings.SyncStatus} syncStatus 294 * @param {?settings.SyncStatus} syncStatus
278 * @return {boolean} 295 * @return {boolean}
279 */ 296 */
280 isAdvancedSyncSettingsVisible_: function(syncStatus) { 297 isAdvancedSyncSettingsVisible_: function(syncStatus) {
281 return !!syncStatus && !!syncStatus.signedIn && 298 return !!syncStatus && !!syncStatus.signedIn &&
282 !!syncStatus.syncSystemEnabled; 299 !!syncStatus.syncSystemEnabled;
283 }, 300 },
284 301
285 /** 302 /**
286 * @private 303 * @private
287 * @param {?settings.SyncStatus} syncStatus 304 * @param {?settings.SyncStatus} syncStatus
288 * @return {string} 305 * @return {string}
289 */ 306 */
290 getSyncIcon_: function(syncStatus) { 307 getSyncIcon_: function(syncStatus) {
291 if (!syncStatus) 308 if (!syncStatus)
292 return ''; 309 return '';
293 if (syncStatus.hasError) 310 if (syncStatus.hasError)
294 return 'settings:sync-problem'; 311 return 'settings:sync-problem';
295 if (syncStatus.managed) 312 if (syncStatus.managed)
296 return 'settings:sync-disabled'; 313 return 'settings:sync-disabled';
297 314
298 return 'settings:done'; 315 return 'settings:done';
299 }, 316 },
300 }); 317 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698