From 9f29a0ed2687dcbf144e8b830afa5464237cf466 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Tue, 29 Feb 2000 22:35:33 +0000 Subject: [PATCH] WebShell now relies on the docShell for the creation of the content viewer. WebShell also provides and implementation for LoadURI that overrides the docShells so we can later do a ifdef on who should do the load. Before adding to GlobalHistory we call ShouldAddToGlobalHistory. Implemented GetMainWidget. This is work to allow getting new session history/ url loading working and work on master bug 13374. r=mscott a=jevering git-svn-id: svn://10.0.0.236/trunk@61916 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 290 +++++---------------------- mozilla/webshell/src/nsWebShell.cpp | 290 +++++---------------------- 2 files changed, 104 insertions(+), 476 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index fee1a9f7ae5..11ec7d9a0ce 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -212,6 +212,8 @@ public: NS_DECL_NSIDOCUMENTLOADEROBSERVER + NS_IMETHOD SetupNewViewer(nsIContentViewer* aViewer); + // nsIContentViewerContainer NS_IMETHOD Embed(nsIContentViewer* aDocViewer, const char* aCommand, @@ -268,6 +270,7 @@ public: const PRUnichar* aReferrer=nsnull, const char * aWindowTarget = nsnull); + NS_IMETHOD LoadURI(const PRUnichar* aURI); NS_IMETHOD InternalLoad(nsIURI* aURI, nsIURI* aReferrer, nsIInputStream* aPostData, loadType aLoadType); @@ -798,133 +801,40 @@ nsWebShell::GetInterface(const nsIID &aIID, void** aInstancePtr) return rv; } +NS_IMETHODIMP +nsWebShell::SetupNewViewer(nsIContentViewer* aViewer) +{ + PRInt32 x, y, cx, cy; + + GetPositionAndSize(&x, &y, &cx, &cy); + + NS_ENSURE_SUCCESS(nsDocShell::SetupNewViewer(aViewer), NS_ERROR_FAILURE); + // If the history state has been set by session history, + // set it on the pres shell now that we have a content + // viewer. + if(mContentViewer && mHistoryState) + { + nsCOMPtr docv(do_QueryInterface(mContentViewer)); + if(docv) + { + nsCOMPtr shell; + docv->GetPresShell(*getter_AddRefs(shell)); + if(shell) + shell->SetHistoryState((nsILayoutHistoryState*)mHistoryState); + } + } + + SetPositionAndSize(x, y, cx, cy, PR_TRUE); + + return NS_OK; +} + NS_IMETHODIMP nsWebShell::Embed(nsIContentViewer* aContentViewer, const char* aCommand, nsISupports* aExtraInfo) { - nsresult rv; - nsRect bounds; - - WEB_TRACE(WEB_TRACE_CALLS, - ("nsWebShell::Embed: this=%p aDocViewer=%p aCommand=%s aExtraInfo=%p", - this, aContentViewer, aCommand ? aCommand : "", aExtraInfo)); - - // - // Copy content viewer state from previous or parent content viewer. - // - // The following logic is mirrored in nsHTMLDocument::StartDocumentLoad! - // - // Do NOT to maintain a reference to the old content viewer outside - // of this "copying" block, or it will not be destroyed until the end of - // this routine and all