merge m-c to fx-team

This commit is contained in:
Tim Taubert 2013-11-04 16:40:40 +01:00
commit 9fe19cfeb5
6 changed files with 66 additions and 12 deletions

View File

@ -72,12 +72,15 @@ var gPluginHandler = {
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;
},

View File

@ -3243,10 +3243,22 @@ function OpenBrowserWindow(options)
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"]

View File

@ -95,5 +95,6 @@ function part8() {
ok(objLoadingContent.activated, "plugin should be activated now");
gNewWindow.close();
gNewWindow = null;
finish();
}

View File

@ -42,7 +42,14 @@ function finishTest() {
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() {

View File

@ -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);
executeSoon(finish);
});
}

View File

@ -1287,15 +1287,47 @@ BrowserGlue.prototype = {
_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) {