From cdda7836f76a1610cf0c76ce47a96f9674637c01 Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Wed, 7 Feb 2001 04:59:43 +0000 Subject: [PATCH] removing nsIWebBrowserChrome::FindNamedBrowserItem per 5 Feb 01 API review. functionality has been moved to nsDocShellTreeOwner. r=scc,valeski --- .../src/control/WebBrowserContainer.cpp | 7 ------- .../browser/gtk/src/GtkMozEmbedChrome.cpp | 11 +++++++++-- .../browser/photon/src/PhMozEmbedChrome.cpp | 6 ++++-- .../powerplant/source/CWebBrowserChrome.cpp | 7 +++++++ .../browser/webBrowser/nsIWebBrowserChrome.idl | 14 ++------------ embedding/tests/gtkEmbed/WebBrowserChrome.cpp | 18 +----------------- embedding/tests/mfcembed/BrowserImpl.cpp | 8 +++++++- webshell/tests/viewer/nsWebBrowserChrome.cpp | 7 +++++++ xpfe/appshell/src/nsContentTreeOwner.cpp | 7 ------- 9 files changed, 37 insertions(+), 48 deletions(-) diff --git a/embedding/browser/activex/src/control/WebBrowserContainer.cpp b/embedding/browser/activex/src/control/WebBrowserContainer.cpp index ce59099cff1c..d0159701dc5b 100644 --- a/embedding/browser/activex/src/control/WebBrowserContainer.cpp +++ b/embedding/browser/activex/src/control/WebBrowserContainer.cpp @@ -664,13 +664,6 @@ CWebBrowserContainer::CreateBrowserWindow(PRUint32 chromeFlags, PRInt32 aX, PRI } -NS_IMETHODIMP -CWebBrowserContainer::FindNamedBrowserItem(const PRUnichar *aName, nsIDocShellTreeItem **_retval) -{ - return NS_ERROR_FAILURE; -} - - NS_IMETHODIMP CWebBrowserContainer::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) { diff --git a/embedding/browser/gtk/src/GtkMozEmbedChrome.cpp b/embedding/browser/gtk/src/GtkMozEmbedChrome.cpp index cefbe28e506e..059762155193 100644 --- a/embedding/browser/gtk/src/GtkMozEmbedChrome.cpp +++ b/embedding/browser/gtk/src/GtkMozEmbedChrome.cpp @@ -432,10 +432,16 @@ NS_IMETHODIMP GtkMozEmbedChrome::SetChromeFlags(PRUint32 aChromeFlags) NS_IMETHODIMP GtkMozEmbedChrome::CreateBrowserWindow(PRUint32 chromeMask, PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, nsIWebBrowser **_retval) { - PR_LOG(mozEmbedLm, PR_LOG_DEBUG, ("GtkMozEmbedChrome::GetNewBrowser\n")); - return NS_ERROR_FAILURE; + PR_LOG(mozEmbedLm, PR_LOG_DEBUG, ("GtkMozEmbedChrome::CreateBrowserWindow\n")); + return NS_ERROR_NOT_IMPLEMENTED; } +#if 0 +/* Just commenting out for now because it looks like somebody went to + a lot of work here. This method has been removed from nsIWebBrowserChrome + per the 5 Feb 01 API review, to be handled one level further down + in nsDocShellTreeOwner. +*/ NS_IMETHODIMP GtkMozEmbedChrome::FindNamedBrowserItem(const PRUnichar *aName, nsIDocShellTreeItem **_retval) { @@ -462,6 +468,7 @@ NS_IMETHODIMP GtkMozEmbedChrome::FindNamedBrowserItem(const PRUnichar *aName, return NS_OK; } +#endif NS_IMETHODIMP GtkMozEmbedChrome::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) { diff --git a/embedding/browser/photon/src/PhMozEmbedChrome.cpp b/embedding/browser/photon/src/PhMozEmbedChrome.cpp index 8c7eef6482f0..178efeae35a7 100644 --- a/embedding/browser/photon/src/PhMozEmbedChrome.cpp +++ b/embedding/browser/photon/src/PhMozEmbedChrome.cpp @@ -391,10 +391,11 @@ NS_IMETHODIMP PhMozEmbedChrome::SetChromeFlags(PRUint32 aChromeFlags) NS_IMETHODIMP PhMozEmbedChrome::CreateBrowserWindow(PRUint32 chromeMask, PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, nsIWebBrowser **_retval) { - PR_LOG(mozEmbedLm, PR_LOG_DEBUG, ("PhMozEmbedChrome::GetNewBrowser\n")); - return NS_ERROR_FAILURE; + PR_LOG(mozEmbedLm, PR_LOG_DEBUG, ("PhMozEmbedChrome::CreateBrowserWindow\n")); + return NS_ERROR_NOT_IMPLEMENTED; } +#if 0 NS_IMETHODIMP PhMozEmbedChrome::FindNamedBrowserItem(const PRUnichar *aName, nsIDocShellTreeItem **_retval) { @@ -421,6 +422,7 @@ NS_IMETHODIMP PhMozEmbedChrome::FindNamedBrowserItem(const PRUnichar *aName, return NS_OK; } +#endif NS_IMETHODIMP PhMozEmbedChrome::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) { diff --git a/embedding/browser/powerplant/source/CWebBrowserChrome.cpp b/embedding/browser/powerplant/source/CWebBrowserChrome.cpp index 22cdb3a25dc7..06e08a82543b 100644 --- a/embedding/browser/powerplant/source/CWebBrowserChrome.cpp +++ b/embedding/browser/powerplant/source/CWebBrowserChrome.cpp @@ -226,6 +226,12 @@ NS_IMETHODIMP CWebBrowserChrome::IsWindowModal(PRBool *_retval) } +#if 0 +/* Just commenting out for now because it looks like somebody went to + a lot of work here. This method has been removed from nsIWebBrowserChrome + per the 5 Feb 01 API review, to be handled one level further down + in nsDocShellTreeOwner. +*/ NS_IMETHODIMP CWebBrowserChrome::FindNamedBrowserItem(const PRUnichar* aName, nsIDocShellTreeItem ** aBrowserItem) { @@ -254,6 +260,7 @@ NS_IMETHODIMP CWebBrowserChrome::FindNamedBrowserItem(const PRUnichar* aName, return NS_OK; // Return OK even if we didn't find it??? } +#endif NS_IMETHODIMP CWebBrowserChrome::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) { diff --git a/embedding/browser/webBrowser/nsIWebBrowserChrome.idl b/embedding/browser/webBrowser/nsIWebBrowserChrome.idl index c2987f348af7..fdaf5ae6c9b2 100644 --- a/embedding/browser/webBrowser/nsIWebBrowserChrome.idl +++ b/embedding/browser/webBrowser/nsIWebBrowserChrome.idl @@ -101,17 +101,7 @@ interface nsIWebBrowserChrome : nsISupports */ nsIWebBrowser createBrowserWindow(in unsigned long chromeFlags, - in long aX, in long aY, in long aCX, in long aCY); - - - /* - Return the child DocShellTreeItem with the specified name. To implement this - an embedder should call nsIDocShellTreeItem::findItemWithName on all the open - webBrowser objects. If one succeeds this should be returned. If they all fail - simply return null. - @param aName - This is the name of the item that is trying to be found. - */ - nsIDocShellTreeItem findNamedBrowserItem(in wstring aName); + in long aX, in long aY, in long aCX, in long aCY); /* Tells the chrome to size itself such that the browser will be the @@ -126,7 +116,7 @@ interface nsIWebBrowserChrome : nsISupports /** Is the window modal (that is, currently executing a modal loop)? - @return true if it's a modal window + @return true if it's a modal window */ boolean isWindowModal(); diff --git a/embedding/tests/gtkEmbed/WebBrowserChrome.cpp b/embedding/tests/gtkEmbed/WebBrowserChrome.cpp index 23200cf6c980..3d4e397c854e 100644 --- a/embedding/tests/gtkEmbed/WebBrowserChrome.cpp +++ b/embedding/tests/gtkEmbed/WebBrowserChrome.cpp @@ -157,22 +157,6 @@ NS_IMETHODIMP WebBrowserChrome::CreateBrowserWindow(PRUint32 chromeMask, } -NS_IMETHODIMP WebBrowserChrome::FindNamedBrowserItem(const PRUnichar* aName, - nsIDocShellTreeItem ** aBrowserItem) -{ - NS_ENSURE_ARG(aName); - NS_ENSURE_ARG_POINTER(aBrowserItem); - *aBrowserItem = nsnull; - - if (!mWebBrowser) - return NS_ERROR_FAILURE; - - nsCOMPtr docShellAsItem(do_QueryInterface(mWebBrowser)); - NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_FAILURE); - - return docShellAsItem->FindItemWithName(aName, NS_STATIC_CAST(nsIWebBrowserChrome*, this), aBrowserItem); -} - NS_IMETHODIMP WebBrowserChrome::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) { return NS_ERROR_NOT_IMPLEMENTED; @@ -187,7 +171,7 @@ NS_IMETHODIMP WebBrowserChrome::ShowAsModal(void) NS_IMETHODIMP WebBrowserChrome::IsWindowModal(PRBool *_retval) { *_retval = PR_FALSE; - return NS_ERROR_NOT_IMPLEMENTED; + return NS_OK; } NS_IMETHODIMP WebBrowserChrome::ExitModalEventLoop(nsresult aStatus) diff --git a/embedding/tests/mfcembed/BrowserImpl.cpp b/embedding/tests/mfcembed/BrowserImpl.cpp index ce9b4856248e..cc56eb98adec 100644 --- a/embedding/tests/mfcembed/BrowserImpl.cpp +++ b/embedding/tests/mfcembed/BrowserImpl.cpp @@ -228,6 +228,11 @@ NS_IMETHODIMP CBrowserImpl::CreateBrowserWindow(PRUint32 chromeMask, PRInt32 aX, // // So, we get called to see if a target by that name already exists // +#if 0 +/* I didn't really want to mess with your code, but this method has + been removed from nsIWebBrowserChrome per the API review meeting + on 5 Feb 01. +*/ NS_IMETHODIMP CBrowserImpl::FindNamedBrowserItem(const PRUnichar *aName, nsIDocShellTreeItem ** aBrowserItem) { @@ -236,6 +241,7 @@ NS_IMETHODIMP CBrowserImpl::FindNamedBrowserItem(const PRUnichar *aName, return m_pBrowserFrameGlue->FindNamedBrowserItem(aName, NS_STATIC_CAST(nsIWebBrowserChrome*, this), aBrowserItem); } +#endif // Gets called in response to set the size of a window // Ex: In response to a JavaScript Window.Open() call of @@ -404,4 +410,4 @@ NS_IMETHODIMP CBrowserImpl::SetTitle(const PRUnichar* aTitle) m_pBrowserFrameGlue->SetBrowserFrameTitle(aTitle); return NS_OK; -} \ No newline at end of file +} diff --git a/webshell/tests/viewer/nsWebBrowserChrome.cpp b/webshell/tests/viewer/nsWebBrowserChrome.cpp index d57957611cd6..af1ebe92840b 100644 --- a/webshell/tests/viewer/nsWebBrowserChrome.cpp +++ b/webshell/tests/viewer/nsWebBrowserChrome.cpp @@ -146,6 +146,12 @@ NS_IMETHODIMP nsWebBrowserChrome::CreateBrowserWindow(PRUint32 aChromeMask, return NS_OK; } +#if 0 +/* Just commenting out for now because it looks like somebody went to + a lot of work here. This method has been removed from nsIWebBrowserChrome + per the 5 Feb 01 API review, to be handled one level further down + in nsDocShellTreeOwner. +*/ NS_IMETHODIMP nsWebBrowserChrome::FindNamedBrowserItem(const PRUnichar* aName, nsIDocShellTreeItem** aBrowserItem) { @@ -170,6 +176,7 @@ NS_IMETHODIMP nsWebBrowserChrome::FindNamedBrowserItem(const PRUnichar* aName, } return NS_OK; } +#endif NS_IMETHODIMP nsWebBrowserChrome::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) { diff --git a/xpfe/appshell/src/nsContentTreeOwner.cpp b/xpfe/appshell/src/nsContentTreeOwner.cpp index 9bbb8985cfff..bdca04187c86 100644 --- a/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -271,13 +271,6 @@ NS_IMETHODIMP nsContentTreeOwner::CreateBrowserWindow(PRUint32 aChromeFlags, return NS_ERROR_FAILURE; } -NS_IMETHODIMP nsContentTreeOwner::FindNamedBrowserItem(const PRUnichar* aName, - nsIDocShellTreeItem** aBrowserItem) -{ - NS_ERROR("Haven't Implemented this yet"); - return NS_ERROR_FAILURE; -} - NS_IMETHODIMP nsContentTreeOwner::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) { NS_ERROR("Haven't Implemented this yet");