author | Tim Taubert <tim.taubert@gmx.de> |
Mon, 13 Aug 2012 09:34:10 -0700 | |
changeset 107684 | a5b58ae99ac9bdb6556ac2765f6534caf8c122d7 |
parent 107683 | c767ba96126f5b9efbd61d3aec3f13c6f172f3e5 |
child 107685 | 274f20ffcc5d98d96e8cbe707ec08bd54e03d20e |
push id | 1490 |
push user | akeybl@mozilla.com |
push date | Mon, 08 Oct 2012 18:29:50 +0000 |
treeherder | mozilla-beta@f335e7dacdc1 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jaws |
bugs | 753448 |
milestone | 17.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
|
browser/base/content/browser.js | file | annotate | diff | comparison | revisions | |
browser/base/content/tabbrowser.xml | file | annotate | diff | comparison | revisions |
--- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -146,16 +146,22 @@ XPCOMUtils.defineLazyModuleGetter(this, #ifdef MOZ_SAFE_BROWSING XPCOMUtils.defineLazyGetter(this, "SafeBrowsing", function() { let tmp = {}; Cu.import("resource://gre/modules/SafeBrowsing.jsm", tmp); return tmp.SafeBrowsing; }); #endif +XPCOMUtils.defineLazyGetter(this, "gBrowserNewTabPreloader", function () { + let tmp = {}; + Cu.import("resource://gre/modules/BrowserNewTabPreloader.jsm", tmp); + return new tmp.BrowserNewTabPreloader(); +}); + let gInitialPages = [ "about:blank", "about:newtab", "about:home", "about:privatebrowsing", "about:sessionrestore" ]; @@ -1396,16 +1402,22 @@ var gBrowserInit = { if (document.mozFullScreen) onMozEnteredDomFullscreen(); #ifdef MOZ_SERVICES_SYNC // initialize the sync UI gSyncUI.init(); #endif + // Don't preload new tab pages when the toolbar is hidden + // (i.e. when the current window is a popup window). + if (window.toolbar.visible) { + gBrowserNewTabPreloader.init(window); + } + gBrowserThumbnails.init(); TabView.init(); setUrlAndSearchBarWidthForConditionalForwardButton(); window.addEventListener("resize", function resizeHandler(event) { if (event.target == window) setUrlAndSearchBarWidthForConditionalForwardButton(); }); @@ -1552,16 +1564,20 @@ var gBrowserInit = { CombinedStopReload.uninit(); gGestureSupport.init(false); FullScreen.cleanup(); Services.obs.removeObserver(gPluginHandler.pluginCrashed, "plugin-crashed"); + if (!__lookupGetter__("gBrowserNewTabPreloader")) { + gBrowserNewTabPreloader.uninit(); + } + try { gBrowser.removeProgressListener(window.XULBrowserWindow); gBrowser.removeTabsProgressListener(window.TabsProgressListener); } catch (ex) { } PlacesStarButton.uninit();
--- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1378,16 +1378,22 @@ Cu.reportError(ex); } } // We start our browsers out as inactive, and then maintain // activeness in the tab switcher. b.docShellIsActive = false; + // If we just created a new tab that loads the default + // newtab url, swap in a preloaded page if possible. + if (aURI == BROWSER_NEW_TAB_URL) { + gBrowserNewTabPreloader.newTab(t); + } + // Check if we're opening a tab related to the current tab and // move it to after the current tab. // aReferrerURI is null or undefined if the tab is opened from // an external application or bookmark, i.e. somewhere other // than the current tab. if ((aRelatedToCurrent == null ? aReferrerURI : aRelatedToCurrent) && Services.prefs.getBoolPref("browser.tabs.insertRelatedAfterCurrent")) { let newTabPos = (this._lastRelatedTab ||