mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1173467 P2 Add nsGlobalWindow utility method to get private browsing boolean. r=ehsan
This commit is contained in:
parent
eb0638b4ec
commit
f527c218dc
@ -10285,11 +10285,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
|
||||
|
||||
nsCOMPtr<nsIDOMStorage> storage;
|
||||
aError = storageManager->CreateStorage(this, principal, documentURI,
|
||||
loadContext && loadContext->UsePrivateBrowsing(),
|
||||
IsPrivateBrowsing(),
|
||||
getter_AddRefs(storage));
|
||||
if (aError.Failed()) {
|
||||
return nullptr;
|
||||
@ -10365,12 +10363,9 @@ nsGlobalWindow::GetLocalStorage(ErrorResult& aError)
|
||||
mDoc->GetDocumentURI(documentURI);
|
||||
}
|
||||
|
||||
nsIDocShell* docShell = GetDocShell();
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
|
||||
|
||||
nsCOMPtr<nsIDOMStorage> storage;
|
||||
aError = storageManager->CreateStorage(this, principal, documentURI,
|
||||
loadContext && loadContext->UsePrivateBrowsing(),
|
||||
IsPrivateBrowsing(),
|
||||
getter_AddRefs(storage));
|
||||
if (aError.Failed()) {
|
||||
return nullptr;
|
||||
@ -11200,9 +11195,7 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(GetDocShell());
|
||||
bool isPrivate = loadContext && loadContext->UsePrivateBrowsing();
|
||||
if (changingStorage->IsPrivate() != isPrivate) {
|
||||
if (changingStorage->IsPrivate() != IsPrivateBrowsing()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -12634,6 +12627,13 @@ nsGlobalWindow::SecurityCheckURL(const char *aURL)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
nsGlobalWindow::IsPrivateBrowsing()
|
||||
{
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(GetDocShell());
|
||||
return loadContext && loadContext->UsePrivateBrowsing();
|
||||
}
|
||||
|
||||
void
|
||||
nsGlobalWindow::FlushPendingNotifications(mozFlushType aType)
|
||||
{
|
||||
|
@ -1351,6 +1351,7 @@ public:
|
||||
already_AddRefed<nsIBaseWindow> GetTreeOwnerWindow();
|
||||
already_AddRefed<nsIWebBrowserChrome> GetWebBrowserChrome();
|
||||
nsresult SecurityCheckURL(const char *aURL);
|
||||
bool IsPrivateBrowsing();
|
||||
|
||||
bool PopupWhitelisted();
|
||||
PopupControlState RevisePopupAbuseLevel(PopupControlState);
|
||||
|
Loading…
Reference in New Issue
Block a user