Bug 867634 - Fix for sync.js error: TypeError: this._msg is null. r=ally
authorJim Mathies <jmathies@mozilla.com>
Tue, 07 May 2013 15:55:49 -0500
changeset 142125 89751c35cda0dc2c6a935b434bd916c38af1eb21
parent 142124 da6db50c6248998a897785c89653d32dc4529d3d
child 142126 85f2eb762eaded51021955df5cd9f5279c097829
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersally
bugs867634
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 867634 - Fix for sync.js error: TypeError: this._msg is null. r=ally
browser/metro/base/content/sync.js
browser/metro/profile/metro.js
--- a/browser/metro/base/content/sync.js
+++ b/browser/metro/base/content/sync.js
@@ -60,17 +60,16 @@ let WeaveGlue = {
 
     this.connect();
     return true;
   },
 #endif
 
   _init: function () {
     this._bundle = Services.strings.createBundle("chrome://browser/locale/sync.properties");
-    this._msg = document.getElementById("prefs-messages");
 
     this._addListeners();
 
     this.setupData = { account: "", password: "" , synckey: "", serverURL: "" };
 
     if (Weave.Status.checkSetup() != Weave.CLIENT_NOT_CONFIGURED) {
       // Put the settings UI into a state of "connecting..." if we are going to auto-connect
       this._elements.connect.firstChild.disabled = true;
@@ -369,42 +368,18 @@ let WeaveGlue = {
     Weave.Service.identity.basicPassword = this.setupData.password;
     Weave.Service.identity.syncKey = this.setupData.synckey;
     Weave.Service.persistLogin();
     Weave.Svc.Obs.notify("weave:service:setup-complete");
     setTimeout(function () { Weave.Service.sync(); }, 0);
   },
 
   disconnect: function disconnect() {
-    // Save credentials for undo
-    let undoData = this.setupData;
-
-    // Remove all credentials
     this.setupData = null;
     Weave.Service.startOver();
-
-    let message = this._bundle.GetStringFromName("notificationDisconnect.label");
-    let button = this._bundle.GetStringFromName("notificationDisconnect.button");
-    let buttons = [ {
-      label: button,
-      accessKey: "",
-      callback: function() { WeaveGlue.connect(undoData); }
-    } ];
-    this.showMessage(message, "undo-disconnect", buttons);
-
-    // Hide the notification when the panel is changed or closed.
-    let panel = document.getElementById("prefs-container");
-    panel.addEventListener("ToolPanelHidden", function onHide(aEvent) {
-      panel.removeEventListener(aEvent.type, onHide, false);
-      let notification = WeaveGlue._msg.getNotificationWithValue("undo-disconnect");
-      if (notification)
-        notification.close();
-    }, false);
-
-    Weave.Service.logout();
   },
 
   sync: function sync() {
     Weave.Service.sync();
   },
 
   _addListeners: function _addListeners() {
     let topics = ["weave:service:setup-complete",
@@ -570,24 +545,16 @@ let WeaveGlue = {
   },
 
   changeName: function changeName(aInput) {
     // Make sure to update to a modified name, e.g., empty-string -> default
     Weave.Service.clientsEngine.localName = aInput.value;
     aInput.value = Weave.Service.clientsEngine.localName;
   },
 
-  showMessage: function showMessage(aMsg, aValue, aButtons) {
-    let notification = this._msg.getNotificationWithValue(aValue);
-    if (notification)
-      return;
-
-    this._msg.appendNotification(aMsg, aValue, "", this._msg.PRIORITY_WARNING_LOW, aButtons);
-  },
-
   _validateServer: function _validateServer(aURL) {
     let uri = Weave.Utils.makeURI(aURL);
 
     if (!uri && aURL)
       uri = Weave.Utils.makeURI("https://" + aURL);
 
     if (!uri)
       return "";
--- a/browser/metro/profile/metro.js
+++ b/browser/metro/profile/metro.js
@@ -6,16 +6,18 @@
 
 #ifdef DEBUG
 // disable content and content script caching
 pref("nglayout.debug.disable_xul_cache", true);
 pref("nglayout.debug.disable_xul_fastload", true);
 pref("devtools.errorconsole.enabled", true);
 #endif
 
+pref("services.sync.log.appender.console", "Trace");
+
 // Enable headless crash reporting by default
 pref("app.reportCrashes", true);
 
 // Debug prefs, see input.js
 pref("metro.debug.treatmouseastouch", false);
 pref("metro.debug.colorizeInputOverlay", false);
 pref("metro.debug.selection.displayRanges", false);
 pref("metro.debug.selection.dumpRanges", false);