From feae809bc345ec197c9298baa316bf4017802c75 Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Tue, 4 Mar 2014 10:24:00 -0500 Subject: [PATCH] Bug 979031 - [Australis] Don't animate the opening of the about:customizing tab. r=dao. --- browser/base/content/browser.js | 11 ++++++++--- browser/base/content/tabbrowser.xml | 3 +++ browser/base/content/utilityOverlay.js | 3 +++ .../components/customizableui/src/CustomizeMode.jsm | 4 +++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index efabcc10b78..08c79f6181f 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -6856,9 +6856,14 @@ let gRemoteTabsUI = { * @param aOpenNew * True to open a new tab and switch to it, if no existing tab is found. * If no suitable window is found, a new one will be opened. + * @param aOpenParams + * If switching to this URI results in us opening a tab, aOpenParams + * will be the parameter object that gets passed to openUILinkIn. Please + * see the documentation for openUILinkIn to see what parameters can be + * passed via this object. * @return True if an existing tab was found, false otherwise */ -function switchToTabHavingURI(aURI, aOpenNew) { +function switchToTabHavingURI(aURI, aOpenNew, aOpenParams) { // This will switch to the tab in aWindow having aURI, if present. function switchIfURIInWindow(aWindow) { // Only switch to the tab if neither the source and desination window are @@ -6906,9 +6911,9 @@ function switchToTabHavingURI(aURI, aOpenNew) { // No opened tab has that url. if (aOpenNew) { if (isBrowserWindow && isTabEmpty(gBrowser.selectedTab)) - gBrowser.selectedBrowser.loadURI(aURI.spec); + openUILinkIn(aURI.spec, "current", aOpenParams); else - openUILinkIn(aURI.spec, "tab"); + openUILinkIn(aURI.spec, "tab", aOpenParams); } return false; diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 3582c3df450..4d9ff1cde7e 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1260,6 +1260,7 @@ var aFromExternal; var aRelatedToCurrent; var aDisableMCB; + var aSkipAnimation; if (arguments.length == 2 && typeof arguments[1] == "object" && !(arguments[1] instanceof Ci.nsIURI)) { @@ -1272,6 +1273,7 @@ aFromExternal = params.fromExternal; aRelatedToCurrent = params.relatedToCurrent; aDisableMCB = params.disableMCB; + aSkipAnimation = params.skipAnimation; } var bgLoad = (aLoadInBackground != null) ? aLoadInBackground : @@ -1285,6 +1287,7 @@ allowThirdPartyFixup: aAllowThirdPartyFixup, fromExternal: aFromExternal, relatedToCurrent: aRelatedToCurrent, + skipAnimation: aSkipAnimation, disableMCB: aDisableMCB}); if (!bgLoad) this.selectedTab = tab; diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index 843e85c9df0..daf3603f356 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -184,6 +184,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) * postData (nsIInputStream) * referrerURI (nsIURI) * relatedToCurrent (boolean) + * skipTabAnimation (boolean) */ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI) { var params; @@ -218,6 +219,7 @@ function openLinkIn(url, where, params) { var aDisallowInheritPrincipal = params.disallowInheritPrincipal; var aInitiatingDoc = params.initiatingDoc; var aIsPrivate = params.private; + var aSkipTabAnimation = params.skipTabAnimation; if (where == "save") { if (!aInitiatingDoc) { @@ -320,6 +322,7 @@ function openLinkIn(url, where, params) { inBackground: loadInBackground, allowThirdPartyFixup: aAllowThirdPartyFixup, relatedToCurrent: aRelatedToCurrent, + skipAnimation: aSkipTabAnimation, disableMCB: aDisableMCB}); break; } diff --git a/browser/components/customizableui/src/CustomizeMode.jsm b/browser/components/customizableui/src/CustomizeMode.jsm index b2763aa7cc2..f728543469c 100644 --- a/browser/components/customizableui/src/CustomizeMode.jsm +++ b/browser/components/customizableui/src/CustomizeMode.jsm @@ -127,7 +127,9 @@ CustomizeMode.prototype = { // We don't need to switch to kAboutURI, or open a new tab at // kAboutURI if we're already on it. if (this.browser.selectedBrowser.currentURI.spec != kAboutURI) { - this.window.switchToTabHavingURI(kAboutURI, true); + this.window.switchToTabHavingURI(kAboutURI, true, { + skipTabAnimation: true, + }); return; }