Bug 636223 - Clear Private Data should disconnect Fennec from Sync [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 24 Feb 2011 17:02:24 -0800
changeset 67427 5e86352d3348458e0e1feb5d41b28c65416a000d
parent 67426 2a7ef5ffe26bec1b483a90d25439a632e032090a
child 67428 c0f4045c775e336b1f773a5dc418ce961f7981cd
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs636223
Bug 636223 - Clear Private Data should disconnect Fennec from Sync [r=mfinkle]
mobile/app/mobile.js
mobile/chrome/content/sanitize.js
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -305,17 +305,16 @@ pref("browser.urlbar.match.title", "#");
 pref("browser.urlbar.match.url", "@");
 pref("browser.urlbar.autocomplete.search_threshold", 5);
 pref("browser.history.grouping", "day");
 pref("browser.history.showSessions", false);
 pref("browser.sessionhistory.max_entries", 50);
 pref("browser.history_expire_days", 180);
 pref("browser.history_expire_days_min", 90);
 pref("browser.history_expire_sites", 40000);
-pref("privacy.item.history", true);
 pref("browser.places.migratePostDataAnnotations", true);
 pref("browser.places.updateRecentTagsUri", true);
 pref("places.frecency.numVisits", 10);
 pref("places.frecency.numCalcOnIdle", 50);
 pref("places.frecency.numCalcOnMigrate", 50);
 pref("places.frecency.updateIdleTime", 60000);
 pref("places.frecency.firstBucketCutoff", 4);
 pref("places.frecency.secondBucketCutoff", 14);
@@ -359,16 +358,17 @@ pref("privacy.item.cookies", true);
 pref("privacy.item.offlineApps", true);
 pref("privacy.item.history", true);
 pref("privacy.item.formdata", true);
 pref("privacy.item.downloads", true);
 pref("privacy.item.passwords", true);
 pref("privacy.item.sessions", true);
 pref("privacy.item.geolocation", true);
 pref("privacy.item.siteSettings", true);
+pref("privacy.item.syncAccount", true);
 
 #ifdef MOZ_PLATFORM_MAEMO
 pref("plugins.force.wmode", "opaque");
 #endif
 
 // URL to the Learn More link XXX this is the firefox one.  Bug 495578 fixes this.
 pref("browser.geolocation.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/geolocation/");
 
--- a/mobile/chrome/content/sanitize.js
+++ b/mobile/chrome/content/sanitize.js
@@ -275,16 +275,29 @@ Sanitizer.prototype = {
         var authMgr = Cc['@mozilla.org/network/http-auth-manager;1'].getService(Ci.nsIHttpAuthManager);
         authMgr.clearAll();
       },
       
       get canClear()
       {
         return true;
       }
+    },
+
+    syncAccount: {
+      clear: function ()
+      {
+        WeaveGlue.disconnect();
+      },
+
+      get canClear()
+      {
+        let autoconnect = Services.prefs.getBoolPref("services.sync.autoconnect");
+        return autoconnect || Weave.Service.isLoggedIn;
+      }
     }
   }
 };
 
 
 // "Static" members
 Sanitizer.prefDomain          = "privacy.sanitize.";
 Sanitizer.prefShutdown        = "sanitizeOnShutdown";