merge m-c to fx-team
authorTim Taubert <ttaubert@mozilla.com>
Mon, 04 Nov 2013 16:40:40 +0100
changeset 153466 74876e3239b38313c986022922a58de9fe854dcf
parent 153410 bd6c7c46afceb57ce84502354683cdbf97401437 (current diff)
parent 153462 77802b9446c389f12a2aae03e342b4b9a4b40cf8 (diff)
child 153467 b74d269ced53cd6f60bb7a756ee763919a8a9e2a
push id35816
push userkwierso@gmail.com
push dateTue, 05 Nov 2013 05:22:53 +0000
treeherdermozilla-inbound@442b47e9fb80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone28.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
merge m-c to fx-team
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -67,22 +67,25 @@ var gPluginHandler = {
            };
   },
 
   // Map the plugin's name to a filtered version more suitable for user UI.
   makeNicePluginName : function (aName) {
     if (aName == "Shockwave Flash")
       return "Adobe Flash";
 
-    // Clean up the plugin name by stripping off any trailing version numbers
-    // or "plugin". EG, "Foo Bar Plugin 1.23_02" --> "Foo Bar"
+    // Clean up the plugin name by stripping off parenthetical clauses,
+    // trailing version numbers or "plugin".
+    // EG, "Foo Bar (Linux) Plugin 1.23_02" --> "Foo Bar"
     // Do this by first stripping the numbers, etc. off the end, and then
     // removing "Plugin" (and then trimming to get rid of any whitespace).
     // (Otherwise, something like "Java(TM) Plug-in 1.7.0_07" gets mangled)
-    let newName = aName.replace(/[\s\d\.\-\_\(\)]+$/, "").replace(/\bplug-?in\b/i, "").trim();
+    let newName = aName.replace(/\(.*?\)/g, "").
+                        replace(/[\s\d\.\-\_\(\)]+$/, "").
+                        replace(/\bplug-?in\b/i, "").trim();
     return newName;
   },
 
   isTooSmall : function (plugin, overlay) {
     // Is the <object>'s size too small to hold what we want to show?
     let pluginRect = plugin.getBoundingClientRect();
     // XXX bug 446693. The text-shadow on the submitted-report text at
     //     the bottom causes scrollHeight to be larger than it should be.
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3238,20 +3238,32 @@ function OpenBrowserWindow(options)
   var telemetryObj = {};
   TelemetryStopwatch.start("FX_NEW_WINDOW_MS", telemetryObj);
 
   function newDocumentShown(doc, topic, data) {
     if (topic == "document-shown" &&
         doc != document &&
         doc.defaultView == win) {
       Services.obs.removeObserver(newDocumentShown, "document-shown");
+      Services.obs.removeObserver(windowClosed, "domwindowclosed");
       TelemetryStopwatch.finish("FX_NEW_WINDOW_MS", telemetryObj);
     }
-  };
+  }
+
+  function windowClosed(subject) {
+    if (subject == win) {
+      Services.obs.removeObserver(newDocumentShown, "document-shown");
+      Services.obs.removeObserver(windowClosed, "domwindowclosed");
+    }
+  }
+
+  // Make sure to remove the 'document-shown' observer in case the window
+  // is being closed right after it was opened to avoid leaking.
   Services.obs.addObserver(newDocumentShown, "document-shown", false);
+  Services.obs.addObserver(windowClosed, "domwindowclosed", false);
 
   var charsetArg = new String();
   var handler = Components.classes["@mozilla.org/browser/clh;1"]
                           .getService(Components.interfaces.nsIBrowserHandler);
   var defaultArgs = handler.defaultArgs;
   var wintype = document.documentElement.getAttribute('windowtype');
 
   var extraFeatures = "";
--- a/browser/base/content/test/general/browser_CTP_drag_drop.js
+++ b/browser/base/content/test/general/browser_CTP_drag_drop.js
@@ -90,10 +90,11 @@ function part8() {
   // Click the activate button on doorhanger to make sure it works
   gNewWindow.PopupNotifications.panel.firstChild._primaryButton.click();
 
   let plugin = gNewWindow.gBrowser.selectedBrowser.contentDocument.getElementById("test");
   let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
   ok(objLoadingContent.activated, "plugin should be activated now");
 
   gNewWindow.close();
+  gNewWindow = null;
   finish();
 }
--- a/browser/base/content/test/general/browser_pageInfo_plugins.js
+++ b/browser/base/content/test/general/browser_pageInfo_plugins.js
@@ -37,17 +37,24 @@ function pageInfoObserve(win, topic, dat
   executeSoon(gNextTest);
 }
 
 function finishTest() {
   gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
   gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
   Services.prefs.clearUserPref("plugins.click_to_play");
   gBrowser.removeCurrentTab();
-  finish();
+
+  gPageInfo = null;
+  gNextTest = null;
+  gTestBrowser = null;
+  gPluginHost = null;
+  gPermissionManager = null;
+
+  executeSoon(finish);
 }
 
 function test() {
   waitForExplicitFinish();
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
   gBrowser.selectedTab = gBrowser.addTab();
--- a/browser/base/content/test/general/browser_private_no_prompt.js
+++ b/browser/base/content/test/general/browser_private_no_prompt.js
@@ -1,13 +1,12 @@
 function test() {
   waitForExplicitFinish();
   var privateWin = OpenBrowserWindow({private: true});
-  privateWin.addEventListener("load", function onload() {
-    privateWin.removeEventListener("load", onload, false);
-    ok(true, "Load listener called");
 
+  whenDelayedStartupFinished(privateWin, function () {
     privateWin.BrowserOpenTab();
     privateWin.BrowserTryToCloseWindow();
     ok(true, "didn't prompt");
-    finish();                        
-  }, false);
-}
\ No newline at end of file
+
+    executeSoon(finish);
+  });
+}
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1282,25 +1282,57 @@ BrowserGlue.prototype = {
                                                     notifyBox.PRIORITY_CRITICAL_MEDIUM,
                                                     buttons);
     notification.persistence = -1; // Until user closes it
   },
 
   _migrateUI: function BG__migrateUI() {
     const UI_VERSION = 14;
     const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
+
+    let wasCustomizedAndOnAustralis = Services.prefs.prefHasUserValue("browser.uiCustomization.state");
     let currentUIVersion = 0;
     try {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } catch(ex) {}
-    if (currentUIVersion >= UI_VERSION)
+    if (!wasCustomizedAndOnAustralis && currentUIVersion >= UI_VERSION)
       return;
 
     this._rdf = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
     this._dataSource = this._rdf.GetDataSource("rdf:local-store");
+
+    // No version check for this as this code should run until we have Australis everywhere:
+    if (wasCustomizedAndOnAustralis) {
+      // This profile's been on australis! If it's missing the back/fwd button
+      // or go/stop/reload button, then put them back:
+      let currentsetResource = this._rdf.GetResource("currentset");
+      let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
+      let currentset = this._getPersist(toolbarResource, currentsetResource);
+      if (currentset.indexOf("unified-back-forward-button") == -1) {
+        currentset = currentset.replace("urlbar-container",
+                                        "unified-back-forward-button,urlbar-container");
+      }
+      if (currentset.indexOf("reload-button") == -1) {
+        currentset = currentset.replace("urlbar-container", "urlbar-container,reload-button");
+      }
+      if (currentset.indexOf("stop-button") == -1) {
+        currentset = currentset.replace("reload-button", "reload-button,stop-button");
+      }
+      this._setPersist(toolbarResource, currentsetResource, currentset);
+      Services.prefs.clearUserPref("browser.uiCustomization.state");
+
+      // If we don't have anything else to do, we can bail here:
+      if (currentUIVersion >= UI_VERSION) {
+        delete this._rdf;
+        delete this._dataSource;
+        return;
+      }
+    }
+
+
     this._dirty = false;
 
     if (currentUIVersion < 2) {
       // This code adds the customizable bookmarks button.
       let currentsetResource = this._rdf.GetResource("currentset");
       let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
       let currentset = this._getPersist(toolbarResource, currentsetResource);
       // Need to migrate only if toolbar is customized and the element is not found.