Bug 722986 - Make WebContentConverter use the per-window Private Browsing APIs in order to decide how to behave; r=ehsan

This commit is contained in:
Hessam Salehi 2012-04-16 23:51:04 -04:00
Родитель 89d455b273
Коммит afaf8bd917
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -401,9 +401,8 @@ WebContentConverterRegistrar.prototype = {
function WCCR_registerProtocolHandler(aProtocol, aURIString, aTitle, aContentWindow) {
LOG("registerProtocolHandler(" + aProtocol + "," + aURIString + "," + aTitle + ")");
if (Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService).
privateBrowsingEnabled) {
var browserWindow = this._getBrowserWindowForContentWindow(aContentWindow);
if (browserWindow.gPrivateBrowsingUI.privateWindow) {
// Inside the private browsing mode, we don't want to alert the user to save
// a protocol handler. We log it to the error console so that web developers
// would have some way to tell what's going wrong.
@ -488,7 +487,7 @@ WebContentConverterRegistrar.prototype = {
buttons = [addButton];
}
var browserWindow = this._getBrowserWindowForContentWindow(aContentWindow);
var browserElement = this._getBrowserForContentWindow(browserWindow, aContentWindow);
var notificationBox = browserWindow.getBrowser().getNotificationBox(browserElement);
notificationBox.appendNotification(message,