Bug 847971 - Make openURL select recent windows that match the current privacy state. r=dolske

--HG--
rename : browser/modules/RecentWindow.jsm => toolkit/modules/RecentWindow.jsm
This commit is contained in:
Josh Matthews 2013-03-14 17:41:52 -04:00
parent 870c8b66d3
commit 5ae7f5bad3
9 changed files with 13 additions and 11 deletions

View File

@ -7,7 +7,7 @@ let Ci = Components.interfaces;
let Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/RecentWindow.jsm");
Cu.import("resource://gre/modules/RecentWindow.jsm");
const nsIWebNavigation = Ci.nsIWebNavigation;

View File

@ -23,7 +23,7 @@ Cu.import("resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");
"resource://gre/modules/RecentWindow.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
"resource://gre/modules/FileUtils.jsm");

View File

@ -31,7 +31,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gBrowserGlue",
"@mozilla.org/browser/browserglue;1",
"nsIBrowserGlue");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");
"resource://gre/modules/RecentWindow.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");

View File

@ -8,7 +8,7 @@ Components.utils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");
"resource://gre/modules/RecentWindow.jsm");
const nsISupports = Components.interfaces.nsISupports;

View File

@ -57,7 +57,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "KeywordURLResetPrompter",
"resource:///modules/KeywordURLResetPrompter.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");
"resource://gre/modules/RecentWindow.jsm");
const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser";
const PREF_PLUGINS_UPDATEURL = "plugins.update.url";

View File

@ -25,11 +25,6 @@ EXTRA_JS_MODULES = \
SharedFrame.jsm \
$(NULL)
EXTRA_PP_JS_MODULES = \
RecentWindow.jsm \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
EXTRA_JS_MODULES += \
WindowsPreviewPerTab.jsm \

View File

@ -5,6 +5,7 @@
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
Components.utils.import("resource://gre/modules/RecentWindow.jsm");
var ContentAreaUtils = {
@ -1072,7 +1073,9 @@ function openURL(aURL)
protocolSvc.loadUrl(uri);
}
else {
var recentWindow = Services.wm.getMostRecentWindow("navigator:browser");
let isPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
var recentWindow = RecentWindow.getMostRecentWindow({type: "navigator:browser",
private: isPrivate});
if (recentWindow) {
var win = recentWindow.browserDOMWindow.openURI(uri, null,
recentWindow.browserDOMWindow.OPEN_DEFAULTWINDOW,

View File

@ -16,4 +16,8 @@ EXTRA_JS_MODULES := \
Timer.jsm \
$(NULL)
EXTRA_PP_JS_MODULES = \
RecentWindow.jsm \
$(NULL)
include $(topsrcdir)/config/rules.mk