mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 723004 - Port nsLoginManagerPrompter to the per-window private browsing API; r=dolske
This commit is contained in:
parent
3eff91e626
commit
e771ad5957
@ -9,6 +9,7 @@ const Cr = Components.results;
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
|
||||
/*
|
||||
* LoginManagerPromptFactory
|
||||
@ -245,13 +246,15 @@ LoginManagerPrompter.prototype = {
|
||||
|
||||
// Whether we are in private browsing mode
|
||||
get _inPrivateBrowsing() {
|
||||
// The Private Browsing service might not be available.
|
||||
try {
|
||||
var pbs = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
return pbs.privateBrowsingEnabled;
|
||||
} catch (e) {
|
||||
return false;
|
||||
if (this._window) {
|
||||
return PrivateBrowsingUtils.isWindowPrivate(this._window);
|
||||
} else {
|
||||
// If we don't that we're in private browsing mode if the caller did
|
||||
// not provide a window. The callers which really care about this
|
||||
// will indeed pass down a window to us, and for those who don't,
|
||||
// we can just assume that we don't want to save the entered login
|
||||
// information.
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user