Bug 1445298 - Remove global nsIWebNavigation constant from browser.js. r=Felipe

MozReview-Commit-ID: 27NdHKNnyJa

--HG--
extra : rebase_source : 00706988f93942d7c4a5e7bd76fa92d3184c0cbe
This commit is contained in:
Dão Gottwald 2018-03-13 17:07:40 +01:00
Родитель b2c12ddb46
Коммит 6a87ef97bf
2 изменённых файлов: 17 добавлений и 19 удалений

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

@ -222,8 +222,6 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function() {
return null;
});
const nsIWebNavigation = Ci.nsIWebNavigation;
var gBrowser;
var gLastValidURLStr = "";
var gInPrintPreviewMode = false;
@ -1195,7 +1193,7 @@ var gBrowserInit = {
gBrowser.init();
window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(nsIWebNavigation)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem).treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow)
@ -2174,9 +2172,8 @@ function BrowserHandleShiftBackspace() {
}
function BrowserStop() {
const stopFlags = nsIWebNavigation.STOP_ALL;
maybeRecordAbandonmentTelemetry(gBrowser.selectedTab, "stop");
gBrowser.webNavigation.stop(stopFlags);
gBrowser.webNavigation.stop(Ci.nsIWebNavigation.STOP_ALL);
}
function BrowserReloadOrDuplicate(aEvent) {
@ -2202,13 +2199,14 @@ function BrowserReload() {
// Bug 1167797: For view source, we always skip the cache
return BrowserReloadSkipCache();
}
const reloadFlags = nsIWebNavigation.LOAD_FLAGS_NONE;
const reloadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
BrowserReloadWithFlags(reloadFlags);
}
function BrowserReloadSkipCache() {
// Bypass proxy and cache.
const reloadFlags = nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
const reloadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY |
Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
BrowserReloadWithFlags(reloadFlags);
}
@ -3153,7 +3151,7 @@ var BrowserOnClick = {
// but add a notify bar as a reminder, so that they don't lose
// track after, e.g., tab switching.
gBrowser.loadURIWithFlags(gBrowser.currentURI.spec,
nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
null, null, null);
Services.perms.add(gBrowser.currentURI, "safe-browsing",
@ -5321,11 +5319,11 @@ nsBrowserAccess.prototype = {
Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL :
Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
gBrowser.loadURIWithFlags(aURI.spec, {
aTriggeringPrincipal,
flags: loadflags,
referrerURI: referrer,
referrerPolicy,
});
aTriggeringPrincipal,
flags: loadflags,
referrerURI: referrer,
referrerPolicy,
});
}
if (!Services.prefs.getBoolPref("browser.tabs.loadDivertedInBackground"))
window.focus();
@ -6205,7 +6203,7 @@ function BrowserSetForcedCharacterSet(aCharset) {
}
function BrowserCharsetReload() {
BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
BrowserReloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
}
function UpdateCurrentCharset(target) {

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

@ -61,7 +61,7 @@ function loadWebPanel(aURI) {
var panelBrowser = getPanelBrowser();
if (gLoadFired) {
panelBrowser.webNavigation
.loadURI(aURI, nsIWebNavigation.LOAD_FLAGS_NONE,
.loadURI(aURI, Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
null, null, null);
}
panelBrowser.setAttribute("cachedurl", aURI);
@ -75,7 +75,7 @@ function load() {
var cachedurl = panelBrowser.getAttribute("cachedurl");
if (cachedurl) {
panelBrowser.webNavigation
.loadURI(cachedurl, nsIWebNavigation.LOAD_FLAGS_NONE, null,
.loadURI(cachedurl, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null,
null, null);
}
@ -87,12 +87,12 @@ function unload() {
}
function PanelBrowserStop() {
getPanelBrowser().webNavigation.stop(nsIWebNavigation.STOP_ALL);
getPanelBrowser().webNavigation.stop(Ci.nsIWebNavigation.STOP_ALL);
}
function PanelBrowserReload() {
getPanelBrowser().webNavigation
.sessionHistory
.QueryInterface(nsIWebNavigation)
.reload(nsIWebNavigation.LOAD_FLAGS_NONE);
.QueryInterface(Ci.nsIWebNavigation)
.reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE);
}