From ec20564f0a61b4f1dc58d9ec490d4b66a6543ae0 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 28 Oct 2003 23:41:25 +0000 Subject: Make some vars private, remove an unused one. 2003-10-29 Marco Pesenti Gritti * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: Make some vars private, remove an unused one. * embed/mozilla/EventContext.cpp: Use the content dom document to determine is_framed_page. --- embed/mozilla/EphyBrowser.cpp | 4 +--- embed/mozilla/EphyBrowser.h | 7 +++---- embed/mozilla/EventContext.cpp | 6 +++++- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'embed/mozilla') diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 9dbafbbd7..7579d8712 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -91,8 +91,6 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed) { nsresult rv; - mGtkMozEmbed = mozembed; - gtk_moz_embed_get_nsIWebBrowser (mozembed, getter_AddRefs(mWebBrowser)); if (!mWebBrowser) return NS_ERROR_FAILURE; @@ -106,7 +104,7 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed) mEventListener = new EphyEventListener(); - rv = mEventListener->Init (EPHY_EMBED (mGtkMozEmbed)); + rv = mEventListener->Init (EPHY_EMBED (mozembed)); if (NS_FAILED (rv)) return NS_ERROR_FAILURE; rv = GetListener(); diff --git a/embed/mozilla/EphyBrowser.h b/embed/mozilla/EphyBrowser.h index 4d4a11da6..6cd0b5d57 100644 --- a/embed/mozilla/EphyBrowser.h +++ b/embed/mozilla/EphyBrowser.h @@ -80,20 +80,20 @@ public: nsresult PushTargetDocument (nsIDOMDocument *domDoc); nsresult PopTargetDocument (); + nsresult GetContentViewer (nsIContentViewer **aViewer); nsresult GetDocument (nsIDOMDocument **aDOMDocument); nsresult GetTargetDocument (nsIDOMDocument **aDOMDocument); nsresult GetDocumentUrl (nsCString &url); nsresult GetTargetDocumentUrl (nsCString &url); nsCOMPtr mWebBrowser; - nsCOMPtr mDOMWindow; - nsCOMPtr mDOMDocument; - GtkMozEmbed *mGtkMozEmbed; private: nsCOMPtr mTargetDocument; nsCOMPtr mProgress; nsCOMPtr mEventReceiver; + nsCOMPtr mDOMWindow; + nsCOMPtr mDOMDocument; EphyEventListener *mEventListener; nsresult GetListener (void); @@ -105,7 +105,6 @@ private: nsresult GetSHistory (nsISHistory **aSHistory); nsresult GetPIDOMWindow(nsPIDOMWindow **aPIWin); nsresult GetWebNavigation(nsIWebNavigation **aWebNavigation); - nsresult GetContentViewer (nsIContentViewer **aViewer); }; #endif diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp index 1ef9de9eb..dd497f533 100644 --- a/embed/mozilla/EventContext.cpp +++ b/embed/mozilla/EventContext.cpp @@ -23,6 +23,7 @@ #endif #include "EventContext.h" +#include "nsIContentViewer.h" #include "nsIDOMEventTarget.h" #include "nsIDocument.h" #include "nsIDOMHTMLInputElement.h" @@ -769,9 +770,12 @@ nsresult EventContext::GetKeyEventInfo (nsIDOMKeyEvent *aKeyEvent, EphyEmbedEven nsresult EventContext::IsPageFramed (nsIDOMNode *node, PRBool *Framed) { nsresult result; + + nsCOMPtr contentViewer; + result = mBrowser->GetContentViewer (getter_AddRefs(contentViewer)); nsCOMPtr mainDocument; - result = mBrowser->GetDocument (getter_AddRefs(mainDocument)); + result = contentViewer->GetDOMDocument (getter_AddRefs(mainDocument)); if (NS_FAILED(result) || !mainDocument) return NS_ERROR_FAILURE; nsCOMPtr nodeDocument; -- cgit