Bug 1513895 - Unify PopupBlocker algorithm in 1 single file, r=smaug

This commit is contained in:
Andrea Marchesini
2018-12-16 10:21:16 +01:00
parent e14a575f16
commit ab2f923d5e
35 changed files with 620 additions and 586 deletions

View File

@@ -47,6 +47,7 @@
#include "mozilla/dom/HTMLAnchorElement.h"
#include "mozilla/dom/PerformanceNavigation.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/dom/PopupBlocker.h"
#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
#include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/dom/ScriptSettings.h"
@@ -3966,12 +3967,12 @@ nsDocShell::LoadURIWithOptions(const nsAString& aURI, uint32_t aLoadFlags,
return NS_ERROR_FAILURE;
}
PopupControlState popupState;
PopupBlocker::PopupControlState popupState;
if (aLoadFlags & LOAD_FLAGS_ALLOW_POPUPS) {
popupState = openAllowed;
popupState = PopupBlocker::openAllowed;
aLoadFlags &= ~LOAD_FLAGS_ALLOW_POPUPS;
} else {
popupState = openOverridden;
popupState = PopupBlocker::openOverridden;
}
nsAutoPopupStatePusher statePusher(popupState);
@@ -12520,7 +12521,7 @@ class OnLinkClickEvent : public Runnable {
nsCOMPtr<nsIInputStream> mPostDataStream;
nsCOMPtr<nsIInputStream> mHeadersDataStream;
nsCOMPtr<nsIContent> mContent;
PopupControlState mPopupState;
PopupBlocker::PopupControlState mPopupState;
bool mNoOpenerImplied;
bool mIsUserTriggered;
bool mIsTrusted;
@@ -12543,7 +12544,7 @@ OnLinkClickEvent::OnLinkClickEvent(nsDocShell* aHandler, nsIContent* aContent,
mPostDataStream(aPostDataStream),
mHeadersDataStream(aHeadersDataStream),
mContent(aContent),
mPopupState(mHandler->mScriptGlobal->GetPopupControlState()),
mPopupState(PopupBlocker::GetPopupControlState()),
mNoOpenerImplied(aNoOpenerImplied),
mIsUserTriggered(aIsUserTriggered),
mIsTrusted(aIsTrusted),