From ddbb0b1bb8d761ec15ae84efedd1ead5384a3cf1 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Fri, 10 Feb 2012 09:27:53 +0000 Subject: [uber settings] more elegant fix for sync crash in my haste to fix the crash I took the easy way out. This is slightly nicer in that it makes the no-sync-system case not jiggly as well, and we can remove one more js function. BUG=none TEST=launching settings, signing into and out of sync, launching settings in incognito Review URL: http://codereview.chromium.org/9370048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121417 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/resources/options2/browser_options.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'chrome/browser/resources') diff --git a/chrome/browser/resources/options2/browser_options.js b/chrome/browser/resources/options2/browser_options.js index 1545ad2..af6ec2c 100644 --- a/chrome/browser/resources/options2/browser_options.js +++ b/chrome/browser/resources/options2/browser_options.js @@ -46,8 +46,7 @@ cr.define('options', function() { OptionsPage.prototype.initializePage.call(this); // Sync (Sign in) section. - if (templateData.syncData) - this.updateSyncState_(templateData.syncData); + this.updateSyncState_(templateData.syncData); $('sync-action-link').onclick = function(event) { SyncSetupOverlay.showErrorUI(); @@ -254,6 +253,12 @@ cr.define('options', function() { * @private */ updateSyncState_: function(syncData) { + if (!syncData.syncSystemEnabled) { + $('sync-section').hidden = true; + return; + } + + $('sync-section').hidden = false; this.syncSetupCompleted = syncData.setupCompleted; $('customize-sync').hidden = !syncData.setupCompleted; @@ -299,10 +304,6 @@ cr.define('options', function() { $('profiles-section').hidden = !visible; }, - hideSyncSection_: function() { - $('sync-section').hidden = true; - }, - /** * Get the start/stop sync button DOM element. Used for testing. * @return {DOMElement} The start/stop sync button. @@ -587,7 +588,6 @@ cr.define('options', function() { //Forward public APIs to private implementations. [ 'getStartStopSyncButton', - 'hideSyncSection', 'setGtkThemeButtonEnabled', 'setInstantFieldTrialStatus', 'setProfilesInfo', -- cgit v1.1