Bug 1254496 - Remove gURLBar null-checks. r=dao

This commit is contained in:
malayaleecoder 2016-03-10 23:15:49 +05:30
Родитель 831eafdf2f
Коммит b3deb181bb
3 изменённых файлов: 29 добавлений и 40 удалений

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

@ -85,10 +85,8 @@ var CustomizationHandler = {
UpdateUrlbarSearchSplitterState();
// Update the urlbar
if (gURLBar) {
URLBarSetURI();
XULBrowserWindow.asyncUpdateUI();
}
URLBarSetURI();
XULBrowserWindow.asyncUpdateUI();
// Re-enable parts of the UI we disabled during the dialog
let menubar = document.getElementById("main-menubar");

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

@ -385,8 +385,7 @@ var PlacesCommandHook = {
}
// Revert the contents of the location bar
if (gURLBar)
gURLBar.handleRevert();
gURLBar.handleRevert();
// If it was not requested to open directly in "edit" mode, we are done.
if (!aShowEditUI)
@ -460,8 +459,7 @@ var PlacesCommandHook = {
}
// Revert the contents of the location bar
if (gURLBar)
gURLBar.handleRevert();
gURLBar.handleRevert();
// If it was not requested to open directly in "edit" mode, we are done.
if (!aShowEditUI)

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

@ -408,10 +408,8 @@ const gSessionHistoryObserver = {
// Hide session restore button on about:home
window.messageManager.broadcastAsyncMessage("Browser:HideSessionRestoreButton");
if (gURLBar) {
// Clear undo history of the URL bar
gURLBar.editor.transactionManager.clear()
}
// Clear undo history of the URL bar
gURLBar.editor.transactionManager.clear()
}
};
@ -462,13 +460,12 @@ var gPopupBlockerObserver = {
if (aEvent.originalTarget != gBrowser.selectedBrowser)
return;
if (!this._reportButton && gURLBar)
if (!this._reportButton)
this._reportButton = document.getElementById("page-report-button");
if (!gBrowser.selectedBrowser.blockedPopups) {
// Hide the icon in the location bar (if the location bar exists)
if (gURLBar)
this._reportButton.hidden = true;
this._reportButton.hidden = true;
// Hide the notification box (if it's visible).
let notificationBox = gBrowser.getNotificationBox();
@ -479,8 +476,7 @@ var gPopupBlockerObserver = {
return;
}
if (gURLBar)
this._reportButton.hidden = false;
this._reportButton.hidden = false;
// Only show the notification again if we've not already shown it. Since
// notifications are per-browser, we don't need to worry about re-adding
@ -997,10 +993,8 @@ var gBrowserInit = {
if (!window.toolbar.visible) {
// adjust browser UI for popups
if (gURLBar) {
gURLBar.setAttribute("readonly", "true");
gURLBar.setAttribute("enablehistory", "false");
}
gURLBar.setAttribute("readonly", "true");
gURLBar.setAttribute("enablehistory", "false");
goSetCommandEnabled("cmd_newNavigatorTab", false);
}
@ -4340,14 +4334,15 @@ var XULBrowserWindow = {
this.reloadCommand.removeAttribute("disabled");
}
if (gURLBar) {
URLBarSetURI(aLocationURI);
URLBarSetURI(aLocationURI);
BookmarkingUI.onLocationChange();
SocialUI.updateState();
UITour.onLocationChange(location);
gTabletModePageCounter.inc();
}
BookmarkingUI.onLocationChange();
SocialUI.updateState();
UITour.onLocationChange(location);
gTabletModePageCounter.inc();
// Utility functions for disabling find
var shouldDisableFind = function shouldDisableFind(aDocument) {
@ -7288,19 +7283,17 @@ var gPrivateBrowsingUI = {
}
}
if (gURLBar) {
let value = gURLBar.getAttribute("autocompletesearchparam") || "";
if (!PrivateBrowsingUtils.permanentPrivateBrowsing &&
!value.includes("disable-private-actions")) {
// Disable switch to tab autocompletion for private windows.
// We leave it enabled for permanent private browsing mode though.
value += " disable-private-actions";
}
if (!value.includes("private-window")) {
value += " private-window";
}
gURLBar.setAttribute("autocompletesearchparam", value);
let urlBarSearchParam = gURLBar.getAttribute("autocompletesearchparam") || "";
if (!PrivateBrowsingUtils.permanentPrivateBrowsing &&
!urlBarSearchParam.includes("disable-private-actions")) {
// Disable switch to tab autocompletion for private windows.
// We leave it enabled for permanent private browsing mode though.
urlBarSearchParam += " disable-private-actions";
}
if (!urlBarSearchParam.includes("private-window")) {
urlBarSearchParam += " private-window";
}
gURLBar.setAttribute("autocompletesearchparam", urlBarSearchParam);
}
};