Browse Source

nsIDOMWindow to nsPIDOMWindow conversion for Goanna3 nsIDOMWindow change

master
Roy Tam 3 years ago
parent
commit
9049c38782
  1. 6
      k-meleon/app/BrowserImpl.cpp
  2. 9
      k-meleon/app/BrowserImplWebPrgrsLstnr.cpp
  3. 14
      k-meleon/kplugins/adblock/adblock.cpp
  4. 9
      k-meleon/winEmbed/WebBrowserChrome.cpp

6
k-meleon/app/BrowserImpl.cpp

@ -865,13 +865,15 @@ NS_IMETHODIMP CBrowserImpl::HandleEvent(nsIDOMEvent *aEvent)
/* See if this is from the toplevel frame */
nsCOMPtr<nsIDOMWindow> domWin;
nsCOMPtr<nsPIDOMWindow> pdomWin;
domDoc->GetDefaultView(getter_AddRefs(domWin));
NS_ENSURE_TRUE (domWin, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMWindow> topDomWin;
domWin->GetTop (getter_AddRefs (topDomWin));
pdomWin = do_QueryInterface(domWin);
topDomWin = pdomWin->GetTop();
nsCOMPtr<nsISupports> domWinAsISupports (do_QueryInterface (domWin));
nsCOMPtr<nsISupports> domWinAsISupports (do_QueryInterface (pdomWin));
nsCOMPtr<nsISupports> topDomWinAsISupports (do_QueryInterface (topDomWin));
/* disallow subframes to set favicon */
if (domWinAsISupports != topDomWinAsISupports) return NS_OK;

9
k-meleon/app/BrowserImplWebPrgrsLstnr.cpp

@ -37,6 +37,7 @@
#include "nsIRequest.h"
#include "nsIChannel.h"
#include "nsIWebProgress.h"
#include "nsPIDOMWindow.h"
//*****************************************************************************
// CBrowserImpl::nsIWebProgressListener Implementation
@ -148,17 +149,19 @@ NS_IMETHODIMP CBrowserImpl::OnLocationChange(nsIWebProgress* aWebProgress,
if (aWebProgress) {
nsCOMPtr<nsIDOMWindow> domWindow;
nsCOMPtr<nsIDOMWindow> topDomWindow;
nsCOMPtr<nsPIDOMWindow> pdomWindow;
aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
if (domWindow) { // Get root domWindow
domWindow->GetTop(getter_AddRefs(topDomWindow));
pdomWindow = do_QueryInterface(domWindow);
topDomWindow = pdomWindow->GetTop();
}
if (domWindow != topDomWindow)
if (pdomWindow != topDomWindow)
isSubFrameLoad = PR_TRUE;
}
if (isSubFrameLoad)
return NS_OK;
return NS_OK;
m_pBrowserFrameGlue->UpdateCurrentURI(location);

14
k-meleon/kplugins/adblock/adblock.cpp

@ -34,6 +34,7 @@
#include "nsGenericFactory.h"
#include "adcomp.h"
#include "nsEmbedString.h"
#include "nsPIDOMWindow.h"
#include "nsIDOMWindow.h"
#include "nsIDOMDocument.h"
#include "nsIDOMLocation.h"
@ -679,11 +680,10 @@ NS_IMETHODIMP Policy::Observe(nsISupports *aSubject, const char * aTopic, const
static vector<nsIDOMWindow*> domPopup;
if (strcmp(aTopic, "content-document-global-created") == 0)
{
nsCOMPtr<nsIDOMWindow> dom = do_QueryInterface(aSubject);
nsCOMPtr<nsPIDOMWindow> dom = do_QueryInterface(aSubject);
if (!dom) return NS_OK;
nsCOMPtr<nsIDOMWindow> opener;
dom->GetOpener(getter_AddRefs(opener));
nsCOMPtr<nsPIDOMWindow> opener = dom->GetOpener();
if (!opener) return NS_OK;
nsCOMPtr<nsIDOMLocation> location;
@ -749,8 +749,8 @@ NS_IMETHODIMP Policy::Observe(nsISupports *aSubject, const char * aTopic, const
nsCOMPtr<nsIURI> uri;
channel->GetURI(getter_AddRefs(uri));
nsCOMPtr<nsIDOMWindow> opener;
dom->GetOpener(getter_AddRefs(opener));
nsCOMPtr<nsPIDOMWindow> pdom = do_QueryInterface(dom);
nsCOMPtr<nsPIDOMWindow> opener = pdom->GetOpener();
if (!opener) return NS_OK;
nsCOMPtr<nsIDOMDocument> document;
@ -1183,8 +1183,8 @@ void Create(HWND hwnd)
browser->GetContentDOMWindow(getter_AddRefs(dom));
if (!dom) return;
nsCOMPtr<nsIDOMWindow> opener;
dom->GetOpener(getter_AddRefs(opener));
nsCOMPtr<nsPIDOMWindow> pdom = do_QueryInterface(dom);
nsCOMPtr<nsIDOMWindow> opener = pdom->GetOpener();
//kmeleonDocInfo *info = kPlugin.kFuncs->GetDocInfo(hwnd);
//rules.match(info->url

9
k-meleon/winEmbed/WebBrowserChrome.cpp

@ -31,6 +31,7 @@
#include "resource.h"
#include "winEmbed.h"
#include "WebBrowserChrome.h"
#include "nsPIDOMWindow.h"
// OS headers
#include <stdio.h>
@ -284,12 +285,14 @@ NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress* aWebProgress,
PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
if (aWebProgress) {
nsCOMPtr<nsIDOMWindow> domWindow;
nsCOMPtr<nsIDOMWindow> topDomWindow;
nsCOMPtr<nsPIDOMWindow> pdomWindow;
nsCOMPtr<nsPIDOMWindow> topDomWindow;
aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
if (domWindow) { // Get root domWindow
domWindow->GetTop(getter_AddRefs(topDomWindow));
pdomWindow = do_QueryInterface(domWindow);
topDomWindow = pdomWindow->GetTop();
}
if (domWindow != topDomWindow)
if (pdomWindow != topDomWindow)
isSubFrameLoad = PR_TRUE;
}
if (!isSubFrameLoad)

Loading…
Cancel
Save