From 2faee254d033bfb1177098870dcee017d92a7fa1 Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Fri, 30 Nov 2001 22:35:33 +0000 Subject: [PATCH] bug #94205 (r=adamlock@netscape.com, sr=jst@netscape.com) nsIWebNavigation interface changes... git-svn-id: svn://10.0.0.236/trunk@109390 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 84 ++++++++++++++++--- mozilla/docshell/base/nsDocShell.h | 1 + mozilla/docshell/base/nsDocShellLoadInfo.cpp | 7 +- mozilla/docshell/base/nsDocShellLoadInfo.h | 2 +- mozilla/docshell/base/nsIDocShellLoadInfo.idl | 2 +- mozilla/docshell/base/nsIWebNavigation.idl | 13 ++- mozilla/docshell/base/nsWebShell.cpp | 18 +++- mozilla/dom/src/base/nsGlobalWindow.cpp | 9 +- mozilla/editor/composer/src/nsEditorShell.cpp | 10 ++- .../activex/src/control/MozillaBrowser.cpp | 6 +- .../browser/chrome/content/mini-nav.js | 2 +- .../browser/cocoa/src/NSBrowserView.mm | 2 +- .../browser/gtk/src/EmbedPrivate.cpp | 6 +- .../browser/photon/src/PtMozilla.cpp | 8 +- .../powerplant/source/CBrowserShell.cpp | 10 ++- .../browser/webBrowser/nsWebBrowser.cpp | 20 ++++- .../embedding/qa/testembed/BrowserView.cpp | 9 +- mozilla/embedding/qa/testembed/Tests.cpp | 5 +- mozilla/embedding/qa/testembed/nsIWebNav.cpp | 16 ++-- .../embedding/tests/mfcembed/BrowserView.cpp | 9 +- mozilla/embedding/tests/winEmbed/winEmbed.cpp | 10 ++- .../extensions/help/resources/content/help.js | 2 +- .../inspector/resources/content/inspector.js | 2 +- .../content/search/inSearchService.js | 2 +- .../Transformiix/content/transformiix.js | 4 +- .../xmlterm/base/mozXMLTerminal.cpp | 3 +- mozilla/htmlparser/robot/nsDebugRobot.cpp | 6 +- mozilla/mailnews/base/src/nsMessenger.cpp | 6 +- .../mailnews/base/src/nsMsgPrintEngine.cpp | 6 +- .../parser/htmlparser/robot/nsDebugRobot.cpp | 6 +- .../webshell/tests/viewer/nsBrowserWindow.cpp | 15 ++-- .../webshell/tests/viewer/nsWebCrawler.cpp | 4 +- .../webshell/tests/viewer/nsXPBaseWindow.cpp | 2 +- .../xpfe/appshell/src/nsWebShellWindow.cpp | 13 ++- .../bootstrap/appleevents/nsWindowUtils.cpp | 3 +- .../xpfe/browser/resources/content/fastnav.js | 2 +- .../browser/resources/content/navigator.js | 2 +- .../browser/resources/content/viewsource.js | 2 +- .../xpfe/browser/src/nsBrowserInstance.cpp | 7 +- .../components/shistory/src/nsSHistory.cpp | 15 +++- .../components/xremote/src/XRemoteService.cpp | 10 ++- .../resources/content/bindings/browser.xml | 2 +- 42 files changed, 282 insertions(+), 81 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index c3c3adf4d7e..a5ef98594a1 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -410,6 +410,49 @@ ConvertDocShellLoadInfoToLoadType(nsDocShellInfoLoadType aDocShellLoadType) } +nsDocShellInfoLoadType +nsDocShell::ConvertLoadTypeToDocShellLoadInfo(PRUint32 aLoadType) +{ + nsDocShellInfoLoadType docShellLoadType = nsIDocShellLoadInfo::loadNormal; + switch (aLoadType) { + case LOAD_NORMAL: + docShellLoadType = nsIDocShellLoadInfo::loadNormal; + break; + case LOAD_NORMAL_REPLACE: + docShellLoadType = nsIDocShellLoadInfo::loadNormalReplace; + break; + case LOAD_HISTORY: + docShellLoadType = nsIDocShellLoadInfo::loadHistory; + break; + case LOAD_RELOAD_NORMAL: + docShellLoadType = nsIDocShellLoadInfo::loadReloadNormal; + break; + case LOAD_RELOAD_CHARSET_CHANGE: + docShellLoadType = nsIDocShellLoadInfo::loadReloadCharsetChange; + break; + case LOAD_RELOAD_BYPASS_CACHE: + docShellLoadType = nsIDocShellLoadInfo::loadReloadBypassCache; + break; + case LOAD_RELOAD_BYPASS_PROXY: + docShellLoadType = nsIDocShellLoadInfo::loadReloadBypassProxy; + break; + case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE: + docShellLoadType = nsIDocShellLoadInfo::loadReloadBypassProxyAndCache; + break; + case LOAD_LINK: + docShellLoadType = nsIDocShellLoadInfo::loadLink; + break; + case LOAD_REFRESH: + docShellLoadType = nsIDocShellLoadInfo::loadRefresh; + break; + case LOAD_BYPASS_HISTORY: + docShellLoadType = nsIDocShellLoadInfo::loadBypassHistory; + break; + } + + return docShellLoadType; +} + //***************************************************************************** // nsDocShell::nsIDocShell //***************************************************************************** @@ -424,7 +467,7 @@ nsDocShell::LoadURI(nsIURI * aURI, nsCOMPtr owner; PRBool inheritOwner = PR_FALSE; nsCOMPtr shEntry; - nsXPIDLCString target; + nsXPIDLString target; PRUint32 loadType = MAKE_LOAD_TYPE(LOAD_NORMAL, aLoadFlags); NS_ENSURE_ARG(aURI); @@ -530,14 +573,11 @@ nsDocShell::LoadURI(nsIURI * aURI, } } - nsAutoString windowTarget; - windowTarget.AssignWithConversion(target); - rv = InternalLoad(aURI, referrer, owner, inheritOwner, - windowTarget.get(), + target.get(), postStream, nsnull, // No headers stream loadType, @@ -2140,7 +2180,11 @@ NS_IMETHODIMP nsDocShell::GotoIndex(PRInt32 aIndex) NS_IMETHODIMP -nsDocShell::LoadURI(const PRUnichar * aURI, PRUint32 aLoadFlags) +nsDocShell::LoadURI(const PRUnichar * aURI, + PRUint32 aLoadFlags, + nsIURI * aReferingURI, + nsIInputStream * aPostStream, + nsIInputStream * aHeaderStream) { nsCOMPtr uri; @@ -2192,15 +2236,24 @@ nsDocShell::LoadURI(const PRUnichar * aURI, PRUint32 aLoadFlags) NS_LITERAL_STRING("malformedURI").get(), getter_Copies(messageStr)), NS_ERROR_FAILURE); - prompter->Alert(nsnull, messageStr.get()); } if (NS_FAILED(rv) || !uri) return NS_ERROR_FAILURE; - NS_ENSURE_SUCCESS(LoadURI(uri, nsnull, aLoadFlags), NS_ERROR_FAILURE); - return NS_OK; + nsCOMPtr loadInfo; + rv = CreateLoadInfo(getter_AddRefs(loadInfo)); + if (NS_FAILED(rv)) return rv; + + loadInfo->SetLoadType(ConvertLoadTypeToDocShellLoadInfo(aLoadFlags)); + loadInfo->SetPostDataStream(aPostStream); + + // XXX: Need to pass in the extra headers stream too... + // XXX: Need to pass in referer... + + rv = LoadURI(uri, loadInfo, 0); + return rv; } NS_IMETHODIMP @@ -2301,6 +2354,17 @@ nsDocShell::GetCurrentURI(nsIURI ** aURI) return NS_OK; } +NS_IMETHODIMP +nsDocShell::GetReferingURI(nsIURI ** aURI) +{ + NS_ENSURE_ARG_POINTER(aURI); + + *aURI = mReferrerURI; + NS_IF_ADDREF(*aURI); + + return NS_OK; +} + NS_IMETHODIMP nsDocShell::SetSessionHistory(nsISHistory * aSessionHistory) { @@ -4142,7 +4206,7 @@ nsresult nsDocShell::DoURILoad(nsIURI * aURI, nsCOMPtr httpChannel(do_QueryInterface(channel)); // // If this is a HTTP channel, then set up the HTTP specific information - // (ie. POST data, referer, ...) + // (ie. POST data, referrer, ...) // if (httpChannel) { nsCOMPtr cacheChannel(do_QueryInterface(httpChannel)); diff --git a/mozilla/docshell/base/nsDocShell.h b/mozilla/docshell/base/nsDocShell.h index 173230e3978..d2cc4ae4690 100644 --- a/mozilla/docshell/base/nsDocShell.h +++ b/mozilla/docshell/base/nsDocShell.h @@ -191,6 +191,7 @@ public: nsresult SetLoadCookie(nsISupports * aCookie); nsresult GetLoadCookie(nsISupports ** aResult); + nsDocShellInfoLoadType ConvertLoadTypeToDocShellLoadInfo(PRUint32 aLoadType); PRUint32 ConvertDocShellLoadInfoToLoadType(nsDocShellInfoLoadType aDocShellLoadType); protected: diff --git a/mozilla/docshell/base/nsDocShellLoadInfo.cpp b/mozilla/docshell/base/nsDocShellLoadInfo.cpp index 4cf2e0cea7b..24a31567286 100644 --- a/mozilla/docshell/base/nsDocShellLoadInfo.cpp +++ b/mozilla/docshell/base/nsDocShellLoadInfo.cpp @@ -34,7 +34,6 @@ nsDocShellLoadInfo::nsDocShellLoadInfo() NS_INIT_REFCNT(); mLoadType = nsIDocShellLoadInfo::loadNormal; mInheritOwner = PR_FALSE; - mTarget.Assign(""); } nsDocShellLoadInfo::~nsDocShellLoadInfo() @@ -130,16 +129,16 @@ NS_IMETHODIMP nsDocShellLoadInfo::SetSHEntry(nsISHEntry* aSHEntry) return NS_OK; } -NS_IMETHODIMP nsDocShellLoadInfo::GetTarget(char** aTarget) +NS_IMETHODIMP nsDocShellLoadInfo::GetTarget(PRUnichar** aTarget) { NS_ENSURE_ARG_POINTER(aTarget); - *aTarget = ToNewCString(mTarget); + *aTarget = ToNewUnicode(mTarget); return NS_OK; } -NS_IMETHODIMP nsDocShellLoadInfo::SetTarget(const char* aTarget) +NS_IMETHODIMP nsDocShellLoadInfo::SetTarget(const PRUnichar* aTarget) { mTarget.Assign(aTarget); return NS_OK; diff --git a/mozilla/docshell/base/nsDocShellLoadInfo.h b/mozilla/docshell/base/nsDocShellLoadInfo.h index 81634d81949..6ed962a2221 100644 --- a/mozilla/docshell/base/nsDocShellLoadInfo.h +++ b/mozilla/docshell/base/nsDocShellLoadInfo.h @@ -51,7 +51,7 @@ protected: PRBool mInheritOwner; nsDocShellInfoLoadType mLoadType; nsCOMPtr mSHEntry; - nsCString mTarget; + nsString mTarget; nsCOMPtr mPostDataStream; }; diff --git a/mozilla/docshell/base/nsIDocShellLoadInfo.idl b/mozilla/docshell/base/nsIDocShellLoadInfo.idl index 88c5b409290..42a3b744745 100644 --- a/mozilla/docshell/base/nsIDocShellLoadInfo.idl +++ b/mozilla/docshell/base/nsIDocShellLoadInfo.idl @@ -74,7 +74,7 @@ interface nsIDocShellLoadInfo : nsISupports */ attribute nsISHEntry SHEntry; - attribute string target; // like _content, _blank etc + attribute wstring target; // like _content, _blank etc attribute nsIInputStream postDataStream; }; diff --git a/mozilla/docshell/base/nsIWebNavigation.idl b/mozilla/docshell/base/nsIWebNavigation.idl index 5028dcd637b..0dac4ab8c0c 100644 --- a/mozilla/docshell/base/nsIWebNavigation.idl +++ b/mozilla/docshell/base/nsIWebNavigation.idl @@ -135,9 +135,15 @@ interface nsIWebNavigation : nsISupports * @param uri - The URI string to load. * @param loadFlags - Flags modifying load behaviour. Generally you will pass * LOAD_FLAGS_NONE for this parameter. + * @param referrer - The referring URI. If this argument is NULL, the + * referring URI will be inferred internally. * @param postData - nsIInputStream containing POST data for the request. */ - void loadURI(in wstring uri, in unsigned long loadFlags); + void loadURI(in wstring uri, + in unsigned long loadFlags, + in nsIURI referrer, + in nsIInputStream postData, + in nsIInputStream headers); /** * Tells the Object to reload the current page. @@ -185,6 +191,11 @@ interface nsIWebNavigation : nsISupports */ readonly attribute nsIURI currentURI; + /** + * The refering URI. + */ + readonly attribute nsIURI referingURI; + /** * The session history object used to store the session history for the * session. diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index be8c5378cfe..00864114547 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -569,7 +569,11 @@ nsWebShell::LoadDocument(const char* aURL, if(eCharsetReloadRequested != mCharsetReloadState) { mCharsetReloadState = eCharsetReloadRequested; - LoadURI(NS_ConvertASCIItoUCS2(aURL).get(), LOAD_FLAGS_NONE); + LoadURI(NS_ConvertASCIItoUCS2(aURL).get(), // URI string + LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post data stream + nsnull); // Header stream } } } @@ -991,7 +995,11 @@ nsresult nsWebShell::EndPageLoad(nsIWebProgress *aProgress, nsAutoString keywordSpec; keywordSpec.AssignWithConversion("keyword:"); keywordSpec.Append(NS_ConvertUTF8toUCS2(host)); - return LoadURI(keywordSpec.get(), LOAD_FLAGS_NONE); + return LoadURI(keywordSpec.get(), // URI string + LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post data stream + nsnull); // Headers stream } // end keywordsEnabled } @@ -1026,7 +1034,11 @@ nsresult nsWebShell::EndPageLoad(nsIWebProgress *aProgress, if (NS_FAILED(rv)) return rv; // reload the url - return LoadURI(NS_ConvertASCIItoUCS2(host).get(), LOAD_FLAGS_NONE); + return LoadURI(NS_ConvertASCIItoUCS2(host).get(), // URI string + LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post data stream + nsnull); // Header stream } // retry } diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 37fd6274899..ba29a888a29 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -1941,9 +1941,16 @@ NS_IMETHODIMP GlobalWindowImpl::Home() } else homeURL = url; + + nsresult rv; nsCOMPtr webNav(do_QueryInterface(mDocShell)); NS_ENSURE_TRUE(webNav, NS_ERROR_FAILURE); - NS_ENSURE_SUCCESS(webNav->LoadURI(homeURL.get(), nsIWebNavigation::LOAD_FLAGS_NONE), NS_ERROR_FAILURE); + rv = webNav->LoadURI(homeURL.get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); + NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); return NS_OK; } diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index 64d597fd7c4..f19c0431ec4 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -1630,9 +1630,15 @@ nsEditorShell::LoadUrl(const PRUnichar *url) if (NS_FAILED(rv)) return rv; nsCOMPtr webNav(do_QueryInterface(mContentAreaDocShell)); - NS_ENSURE_SUCCESS(webNav->LoadURI(url, nsIWebNavigation::LOAD_FLAGS_NONE), NS_ERROR_FAILURE); + rv = webNav->LoadURI(url, // uri string + nsIWebNavigation::LOAD_FLAGS_NONE, // load flags + nsnull, // referrer + nsnull, // post-data stream + nsnull); // headers stream - return NS_OK; + NS_ASSERTION(NS_SUCCEEDED(rv), "LoadURI failed!"); + + return rv; } diff --git a/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp b/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp index 777a7ac609e..eeff15f4d92 100644 --- a/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp +++ b/mozilla/embedding/browser/activex/src/control/MozillaBrowser.cpp @@ -1868,7 +1868,11 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::Navigate(BSTR URL, VARIANT __RPC_FAR nsCOMPtr spIWebNavigation = do_QueryInterface(mWebBrowser); if (spIWebNavigation) { - res = spIWebNavigation->LoadURI(sUrl.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + res = spIWebNavigation->LoadURI(sUrl.get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); } return res; diff --git a/mozilla/embedding/browser/chrome/content/mini-nav.js b/mozilla/embedding/browser/chrome/content/mini-nav.js index 82bcba80c08..6d76e3c3c97 100644 --- a/mozilla/embedding/browser/chrome/content/mini-nav.js +++ b/mozilla/embedding/browser/chrome/content/mini-nav.js @@ -221,7 +221,7 @@ function SetMenuItemAttr( id, attr, val ) function loadURI(uri) { - getWebNavigation().loadURI(uri, nsIWebNavigation.LOAD_FLAGS_NONE); + getWebNavigation().loadURI(uri, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null); } function BrowserLoadURL() diff --git a/mozilla/embedding/browser/cocoa/src/NSBrowserView.mm b/mozilla/embedding/browser/cocoa/src/NSBrowserView.mm index 442cb20ef25..93deeab2d79 100644 --- a/mozilla/embedding/browser/cocoa/src/NSBrowserView.mm +++ b/mozilla/embedding/browser/cocoa/src/NSBrowserView.mm @@ -675,7 +675,7 @@ nsCocoaBrowserListener::SetContainer(id aContainer) nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY; } - nsresult rv = nav->LoadURI(specStr, navFlags); + nsresult rv = nav->LoadURI(specStr, navFlags, nsnull, nsnull, nsnull); if (NS_FAILED(rv)) { // XXX need to throw } diff --git a/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp b/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp index f60ea0e4d18..6d4a9428d13 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp @@ -319,7 +319,11 @@ void EmbedPrivate::LoadCurrentURI(void) { if (mURI.Length()) - mNavigation->LoadURI(mURI.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + mNavigation->LoadURI(mURI.get(), // URI string + nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post data + nsnull); // extra headers } /* static */ diff --git a/mozilla/embedding/browser/photon/src/PtMozilla.cpp b/mozilla/embedding/browser/photon/src/PtMozilla.cpp index 1a3cfc2a735..3ff1be4ac2a 100644 --- a/mozilla/embedding/browser/photon/src/PtMozilla.cpp +++ b/mozilla/embedding/browser/photon/src/PtMozilla.cpp @@ -238,7 +238,11 @@ static void MozLoadURL(PtMozillaWidget_t *moz, char *url) return; if (moz->MyBrowser->WebNavigation) - moz->MyBrowser->WebNavigation->LoadURI(NS_ConvertASCIItoUCS2(url).get(), nsIWebNavigation::LOAD_FLAGS_NONE); + moz->MyBrowser->WebNavigation->LoadURI(NS_ConvertASCIItoUCS2(url).get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); } // defaults @@ -617,7 +621,7 @@ static void mozilla_modify( PtWidget_t *widget, PtArg_t const *argt ) { case Pt_ARG_MOZ_DOWNLOAD: { moz->MyBrowser->WebBrowserContainer->mSkipOnState = 1; /* ignore nsIWebProgressListener's CWebBrowserContainer::OnStateChange() for a while */ - moz->MyBrowser->WebNavigation->LoadURI( NS_ConvertASCIItoUCS2( (char*) argt->value ).get(), nsIWebNavigation::LOAD_FLAGS_NONE); + moz->MyBrowser->WebNavigation->LoadURI( NS_ConvertASCIItoUCS2( (char*) argt->value ).get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); if( moz->download_dest ) free( moz->download_dest ); moz->download_dest = strdup( (char*)argt->len ); diff --git a/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp b/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp index 0ad0dea8198..79c705d61d5 100644 --- a/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp +++ b/mozilla/embedding/browser/powerplant/source/CBrowserShell.cpp @@ -633,9 +633,13 @@ NS_METHOD CBrowserShell::Reload() NS_METHOD CBrowserShell::LoadURL(const nsACString& urlText) { - nsAutoString unicodeURL; - CopyASCIItoUCS2(urlText, unicodeURL); - return mWebBrowserAsWebNav->LoadURI(unicodeURL.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + nsAutoString unicodeURL; + CopyASCIItoUCS2(urlText, unicodeURL); + return mWebBrowserAsWebNav->LoadURI(unicodeURL.get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); } NS_METHOD CBrowserShell::GetCurrentURL(nsACString& urlText) diff --git a/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp b/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp index a17d4837fb7..9e1b2fa7564 100644 --- a/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp +++ b/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp @@ -588,11 +588,19 @@ NS_IMETHODIMP nsWebBrowser::GoForward() return mDocShellAsNav->GoForward(); } -NS_IMETHODIMP nsWebBrowser::LoadURI(const PRUnichar* aURI, PRUint32 aLoadFlags) +NS_IMETHODIMP nsWebBrowser::LoadURI(const PRUnichar* aURI, + PRUint32 aLoadFlags, + nsIURI* aReferingURI, + nsIInputStream* aPostDataStream, + nsIInputStream* aExtraHeaderStream) { NS_ENSURE_STATE(mDocShell); - return mDocShellAsNav->LoadURI(aURI, aLoadFlags); + return mDocShellAsNav->LoadURI(aURI, + aLoadFlags, + aReferingURI, + aPostDataStream, + aExtraHeaderStream); } NS_IMETHODIMP nsWebBrowser::Reload(PRUint32 aReloadFlags) @@ -623,6 +631,13 @@ NS_IMETHODIMP nsWebBrowser::GetCurrentURI(nsIURI** aURI) return mDocShellAsNav->GetCurrentURI(aURI); } +NS_IMETHODIMP nsWebBrowser::GetReferingURI(nsIURI** aURI) +{ + NS_ENSURE_STATE(mDocShell); + + return mDocShellAsNav->GetReferingURI(aURI); +} + NS_IMETHODIMP nsWebBrowser::SetSessionHistory(nsISHistory* aSessionHistory) { if(mDocShell) @@ -1738,6 +1753,7 @@ NS_IMETHODIMP nsWebBrowser::SetFocusedElement(nsIDOMElement * aFocusedElement) return NS_OK; } + /* helper function */ nsresult nsWebBrowser::DoPrintOrPrintPreview(nsIDOMWindow *aDOMWindow, nsIPrintSettings *aThePrintSettings, diff --git a/mozilla/embedding/qa/testembed/BrowserView.cpp b/mozilla/embedding/qa/testembed/BrowserView.cpp index 2ada65540ea..b687178db08 100644 --- a/mozilla/embedding/qa/testembed/BrowserView.cpp +++ b/mozilla/embedding/qa/testembed/BrowserView.cpp @@ -707,14 +707,17 @@ void CBrowserView::OnFileSaveAs() void CBrowserView::OpenURL(const char* pUrl) { - if(mWebNav) - mWebNav->LoadURI(NS_ConvertASCIItoUCS2(pUrl).get(), nsIWebNavigation::LOAD_FLAGS_NONE); + OpenURL(NS_ConvertASCIItoUCS2(pUrl).get()); } void CBrowserView::OpenURL(const PRUnichar* pUrl) { if(mWebNav) - mWebNav->LoadURI(pUrl, nsIWebNavigation::LOAD_FLAGS_NONE); + mWebNav->LoadURI(pUrl, // URI string + nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post data + nsnull); // Headers stream } CBrowserFrame* CBrowserView::CreateNewBrowserFrame(PRUint32 chromeMask, diff --git a/mozilla/embedding/qa/testembed/Tests.cpp b/mozilla/embedding/qa/testembed/Tests.cpp index c71551b0830..adf82f3902f 100644 --- a/mozilla/embedding/qa/testembed/Tests.cpp +++ b/mozilla/embedding/qa/testembed/Tests.cpp @@ -226,7 +226,10 @@ void CTests::OnTestsChangeUrl() QAOutput("Begin Change URL test.", 1); strcpy(theUrl, myDialog.m_urlfield); rv = qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(), - nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY); + nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY, + nsnull, + nsnull, + nsnull); RvTestResult(rv, "rv LoadURI() test", 1); FormatAndPrintOutput("The url = ", theUrl, 2); diff --git a/mozilla/embedding/qa/testembed/nsIWebNav.cpp b/mozilla/embedding/qa/testembed/nsIWebNav.cpp index 6db5d786508..9f64849b46e 100644 --- a/mozilla/embedding/qa/testembed/nsIWebNav.cpp +++ b/mozilla/embedding/qa/testembed/nsIWebNav.cpp @@ -313,8 +313,11 @@ void CNsIWebNav::LoadUriTest(char *theUrl, const unsigned long theFlag) break; } - rv = qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(), - theFlag); + rv = qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(), + theFlag, + nsnull, + nsnull, + nsnull); sprintf(theTotalString, "%s%s%s%s%s", "LoadURI(): ", theUrl, " w/ ", theFlagName, " test"); RvTestResult(rv, theTotalString, 2); } @@ -369,9 +372,12 @@ void CNsIWebNav::StopUriTest(char *theUrl) { char theTotalString[200]; - qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(), - nsIWebNavigation::LOAD_FLAGS_NONE); - rv = qaWebNav->Stop(nsIWebNavigation::STOP_ALL); + qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); + rv = qaWebNav->Stop(nsIWebNavigation::STOP_ALL); sprintf(theTotalString, "%s%s%s", "Stop(): ", theUrl, " test"); RvTestResult(rv, theTotalString, 2); } diff --git a/mozilla/embedding/tests/mfcembed/BrowserView.cpp b/mozilla/embedding/tests/mfcembed/BrowserView.cpp index 2f8de0ba6d3..ca45a9bba82 100644 --- a/mozilla/embedding/tests/mfcembed/BrowserView.cpp +++ b/mozilla/embedding/tests/mfcembed/BrowserView.cpp @@ -701,14 +701,17 @@ void CBrowserView::OnFileSaveAs() void CBrowserView::OpenURL(const char* pUrl) { - if(mWebNav) - mWebNav->LoadURI(NS_ConvertASCIItoUCS2(pUrl).get(), nsIWebNavigation::LOAD_FLAGS_NONE); + OpenURL(NS_ConvertASCIItoUCS2(pUrl).get()); } void CBrowserView::OpenURL(const PRUnichar* pUrl) { if(mWebNav) - mWebNav->LoadURI(pUrl, nsIWebNavigation::LOAD_FLAGS_NONE); + mWebNav->LoadURI(pUrl, // URI string + nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post data + nsnull); // Extra headers } CBrowserFrame* CBrowserView::CreateNewBrowserFrame(PRUint32 chromeMask, diff --git a/mozilla/embedding/tests/winEmbed/winEmbed.cpp b/mozilla/embedding/tests/winEmbed/winEmbed.cpp index 9d41ea09883..5107e04c99c 100644 --- a/mozilla/embedding/tests/winEmbed/winEmbed.cpp +++ b/mozilla/embedding/tests/winEmbed/winEmbed.cpp @@ -305,7 +305,10 @@ nsresult OpenWebPage(const char *url) chrome->GetWebBrowser(getter_AddRefs(newBrowser)); nsCOMPtr webNav(do_QueryInterface(newBrowser)); return webNav->LoadURI(NS_ConvertASCIItoUCS2(url).get(), - nsIWebNavigation::LOAD_FLAGS_NONE); + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); } return rv; @@ -641,7 +644,10 @@ BOOL CALLBACK BrowserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar sizeof(szURL) / sizeof(szURL[0]) - 1); webNavigation->LoadURI( NS_ConvertASCIItoUCS2(szURL).get(), - nsIWebNavigation::LOAD_FLAGS_NONE); + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); } break; diff --git a/mozilla/extensions/help/resources/content/help.js b/mozilla/extensions/help/resources/content/help.js index 79801f29831..1808ac47341 100644 --- a/mozilla/extensions/help/resources/content/help.js +++ b/mozilla/extensions/help/resources/content/help.js @@ -200,7 +200,7 @@ function getWebNavigation() function loadURI(aURI) { const nsIWebNavigation = Components.interfaces.nsIWebNavigation; - getWebNavigation().loadURI(aURI, nsIWebNavigation.LOAD_FLAGS_NONE); + getWebNavigation().loadURI(aURI, nsIWebNavigation.LOAD_FLAGS_NONE, null ,null, null); } function goBack() diff --git a/mozilla/extensions/inspector/resources/content/inspector.js b/mozilla/extensions/inspector/resources/content/inspector.js index b30632a22e1..64d00aa5773 100644 --- a/mozilla/extensions/inspector/resources/content/inspector.js +++ b/mozilla/extensions/inspector/resources/content/inspector.js @@ -300,7 +300,7 @@ InspectorApp.prototype = browseToURL: function(aURL) { - this.webNavigation.loadURI(aURL, nsIWebNavigation.LOAD_FLAGS_NONE); + this.webNavigation.loadURI(aURL, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null); }, goToWindow: function(aMenuitem) diff --git a/mozilla/extensions/inspector/resources/content/search/inSearchService.js b/mozilla/extensions/inspector/resources/content/search/inSearchService.js index c870be37cab..ac885135b93 100644 --- a/mozilla/extensions/inspector/resources/content/search/inSearchService.js +++ b/mozilla/extensions/inspector/resources/content/search/inSearchService.js @@ -172,7 +172,7 @@ inSearchService.prototype = loadModule: function(aURL) { - this.mWebNav.loadURI(aURL, nsIWebNavigation.LOAD_FLAGS_NONE); + this.mWebNav.loadURI(aURL, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null); this.mLoadingURL = aURL; /* // This method of loading the xml doesn't work, but it should. See bug 54237... diff --git a/mozilla/extensions/transformiix/source/examples/mozilla/Transformiix/content/transformiix.js b/mozilla/extensions/transformiix/source/examples/mozilla/Transformiix/content/transformiix.js index 7fdf643aa51..b4677e92184 100755 --- a/mozilla/extensions/transformiix/source/examples/mozilla/Transformiix/content/transformiix.js +++ b/mozilla/extensions/transformiix/source/examples/mozilla/Transformiix/content/transformiix.js @@ -40,12 +40,12 @@ function onTransform() docShell.viewMode = Components.interfaces.nsIDocShell.viewSource; var webNav = docShell.QueryInterface(Components.interfaces.nsIWebNavigation); var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE; - webNav.loadURI(theXMLURL, loadFlags); + webNav.loadURI(theXMLURL, loadFlags, null, null, null); docShellElement = document.getElementById("xsl-source"); docShell = docShellElement.docShell; docShell.viewMode = Components.interfaces.nsIDocShell.viewSource; webNav = docShell.QueryInterface(Components.interfaces.nsIWebNavigation); - webNav.loadURI(theXSLURL, loadFlags); + webNav.loadURI(theXSLURL, loadFlags, null, null, null); docShellElement = document.getElementById("result-doc"); resultDocument = webNav.document; xmlDocument = resultDocument.implementation.createDocument("", "", null); diff --git a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp index 82be7bc5397..5d0a17105d4 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp @@ -239,7 +239,8 @@ NS_IMETHODIMP mozXMLTerminal::Init(nsIDocShell* aDocShell, if (NS_FAILED(result)) return NS_ERROR_FAILURE; - result = aDocShell->LoadURI(uri, nsnull, nsIWebNavigation::LOAD_FLAGS_NONE); + result = aDocShell->LoadURI(uri, nsnull, nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, nsnull, nsnull); if (NS_FAILED(result)) return NS_ERROR_FAILURE; diff --git a/mozilla/htmlparser/robot/nsDebugRobot.cpp b/mozilla/htmlparser/robot/nsDebugRobot.cpp index 7a6222ad044..8391ddc5676 100644 --- a/mozilla/htmlparser/robot/nsDebugRobot.cpp +++ b/mozilla/htmlparser/robot/nsDebugRobot.cpp @@ -339,7 +339,11 @@ extern "C" NS_EXPORT int DebugRobot( nsAutoString theSpec; theSpec.AssignWithConversion(spec); nsCRT::free(spec); nsCOMPtr webNav(do_QueryInterface(docShell)); - webNav->LoadURI(theSpec.get(), nsIWebNavigation::LOAD_FLAGS_NONE);/* XXX hook up stream listener here! */ + webNav->LoadURI(theSpec.get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull);/* XXX hook up stream listener here! */ while (!g_bReadyForNextUrl) { if (yieldProc != NULL) { (void)url->GetSpec(&spec); diff --git a/mozilla/mailnews/base/src/nsMessenger.cpp b/mozilla/mailnews/base/src/nsMessenger.cpp index 1cb5a98f9f6..e4fb9ee054b 100644 --- a/mozilla/mailnews/base/src/nsMessenger.cpp +++ b/mozilla/mailnews/base/src/nsMessenger.cpp @@ -535,7 +535,11 @@ nsMessenger::OpenURL(const char * url) nsAutoString urlStr; urlStr.AssignWithConversion(unescapedUrl); nsCOMPtr webNav(do_QueryInterface(mDocShell)); if(webNav) - webNav->LoadURI(urlStr.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(urlStr.get(), // URI string + nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post stream + nsnull); // Extra headers } PL_strfree(unescapedUrl); } diff --git a/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp b/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp index 5a2b73a2dc1..fdfcccea2e8 100644 --- a/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp +++ b/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp @@ -317,7 +317,11 @@ nsMsgPrintEngine::FireThatLoadOperation(nsString *uri) { nsCOMPtr webNav(do_QueryInterface(mDocShell)); if (webNav) - rv = webNav->LoadURI(uri->get(), nsIWebNavigation::LOAD_FLAGS_NONE); + rv = webNav->LoadURI(uri->get(), // URI string + nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post data + nsnull); // Extra headers } if (tString) nsCRT::free(tString); diff --git a/mozilla/parser/htmlparser/robot/nsDebugRobot.cpp b/mozilla/parser/htmlparser/robot/nsDebugRobot.cpp index 7a6222ad044..8391ddc5676 100644 --- a/mozilla/parser/htmlparser/robot/nsDebugRobot.cpp +++ b/mozilla/parser/htmlparser/robot/nsDebugRobot.cpp @@ -339,7 +339,11 @@ extern "C" NS_EXPORT int DebugRobot( nsAutoString theSpec; theSpec.AssignWithConversion(spec); nsCRT::free(spec); nsCOMPtr webNav(do_QueryInterface(docShell)); - webNav->LoadURI(theSpec.get(), nsIWebNavigation::LOAD_FLAGS_NONE);/* XXX hook up stream listener here! */ + webNav->LoadURI(theSpec.get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull);/* XXX hook up stream listener here! */ while (!g_bReadyForNextUrl) { if (yieldProc != NULL) { (void)url->GetSpec(&spec); diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 34bd88a4483..4770add8653 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -855,7 +855,7 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) url.AppendInt(ix, 10); url.AppendWithConversion(".html"); nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); - webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); } break; @@ -864,7 +864,7 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) nsAutoString url; url.AssignWithConversion(SAMPLES_BASE_URL); url.AppendWithConversion("/toolbarTest1.xul"); nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); - webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); break; } case VIEWER_XPTOOLKITTREE1: @@ -872,7 +872,7 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) nsAutoString url; url.AssignWithConversion(SAMPLES_BASE_URL); url.AppendWithConversion("/treeTest1.xul"); nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); - webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); break; } @@ -1028,7 +1028,7 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) /* invoke the javascript wallet editor */ nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); - webNav->LoadURI(urlString.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(urlString.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); } break; #endif @@ -1078,7 +1078,7 @@ void nsBrowserWindow::GoTo(const PRUnichar* aURL) { nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); - webNav->LoadURI(aURL, nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(aURL, nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); } @@ -1140,7 +1140,10 @@ nsBrowserWindow::DoFileOpen() // Ask the Web widget to load the file URL nsCOMPtr webNav(do_QueryInterface(mWebBrowser)); webNav->LoadURI(NS_ConvertASCIItoUCS2(url.get()).get(), - nsIWebNavigation::LOAD_FLAGS_NONE); + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); SetVisibility(PR_TRUE); } } diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index 4d4f1063159..ae5aa4910e0 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -877,7 +877,7 @@ nsWebCrawler::LoadNextURL(PRBool aQueueLoad) mCurrentURL = *url; mStartLoad = PR_Now(); nsCOMPtr webNav(do_QueryInterface(webShell)); - webNav->LoadURI(url->get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(url->get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); } NS_RELEASE(webShell); @@ -1121,7 +1121,7 @@ nsWebCrawler::GoToQueuedURL(const nsString& aURL) if (webNav) { mCurrentURL = aURL; mStartLoad = PR_Now(); - webNav->LoadURI(aURL.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(aURL.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); NS_RELEASE(webShell); } mQueuedLoadURLs--; diff --git a/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp b/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp index 8b72aa286df..fa4c7b32217 100644 --- a/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp @@ -392,7 +392,7 @@ NS_IMETHODIMP nsXPBaseWindow::GetTitle(const PRUnichar** aResult) NS_IMETHODIMP nsXPBaseWindow::LoadURL(const nsString& aURL) { nsCOMPtr webNav(do_QueryInterface(mWebShell)); - webNav->LoadURI(aURL.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(aURL.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); return NS_OK; } diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 51034b6a26b..c5dad7c5d6e 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -337,7 +337,12 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent, nsCRT::free(tmpStr); nsCOMPtr webNav(do_QueryInterface(mDocShell)); NS_ENSURE_TRUE(webNav, NS_ERROR_FAILURE); - NS_ENSURE_SUCCESS(webNav->LoadURI(urlString.get(), nsIWebNavigation::LOAD_FLAGS_NONE), NS_ERROR_FAILURE); + rv = webNav->LoadURI(urlString.get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); + NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); } return rv; @@ -1459,7 +1464,11 @@ void nsWebShellWindow::LoadContentAreas() { nsUnescape(urlChar); contentURL.AssignWithConversion(urlChar); nsCOMPtr webNav(do_QueryInterface(contentShell)); - webNav->LoadURI(contentURL.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(contentURL.get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); delete [] urlChar; } NS_RELEASE(contentShell); diff --git a/mozilla/xpfe/bootstrap/appleevents/nsWindowUtils.cpp b/mozilla/xpfe/bootstrap/appleevents/nsWindowUtils.cpp index 83fc21acaef..af645947335 100644 --- a/mozilla/xpfe/bootstrap/appleevents/nsWindowUtils.cpp +++ b/mozilla/xpfe/bootstrap/appleevents/nsWindowUtils.cpp @@ -494,7 +494,6 @@ void LoadURLInWindow(WindowPtr wind, const char* urlString) } } - void LoadURLInXULWindow(nsIXULWindow* inWindow, const char* urlString) { nsCOMPtr contentShell; @@ -505,7 +504,7 @@ void LoadURLInXULWindow(nsIXULWindow* inWindow, const char* urlString) ThrowErrIfNil(webNav, paramErr); nsAutoString urlWString; urlWString.AssignWithConversion(urlString); - webNav->LoadURI(urlWString.get(), nsIWebNavigation::LOAD_FLAGS_NONE); + webNav->LoadURI(urlWString.get(), nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull); } diff --git a/mozilla/xpfe/browser/resources/content/fastnav.js b/mozilla/xpfe/browser/resources/content/fastnav.js index c36093b8ebf..59263bb8d87 100644 --- a/mozilla/xpfe/browser/resources/content/fastnav.js +++ b/mozilla/xpfe/browser/resources/content/fastnav.js @@ -849,7 +849,7 @@ function BrowserCanFindAgain() function loadURI(uri) { try { - getWebNavigation().loadURI(uri, nsIWebNavigation.LOAD_FLAGS_NONE); + getWebNavigation().loadURI(uri, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null); } catch (e) { } } diff --git a/mozilla/xpfe/browser/resources/content/navigator.js b/mozilla/xpfe/browser/resources/content/navigator.js index 78af02a900f..3c5f7219187 100644 --- a/mozilla/xpfe/browser/resources/content/navigator.js +++ b/mozilla/xpfe/browser/resources/content/navigator.js @@ -984,7 +984,7 @@ function BrowserCanFindAgain() function loadURI(uri) { try { - getWebNavigation().loadURI(uri, nsIWebNavigation.LOAD_FLAGS_NONE); + getWebNavigation().loadURI(uri, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null); } catch (e) { } } diff --git a/mozilla/xpfe/browser/resources/content/viewsource.js b/mozilla/xpfe/browser/resources/content/viewsource.js index c4bf6bd5a41..34f9338325d 100644 --- a/mozilla/xpfe/browser/resources/content/viewsource.js +++ b/mozilla/xpfe/browser/resources/content/viewsource.js @@ -75,7 +75,7 @@ function viewSource(url) var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE; var viewSrcUrl = "view-source:" + url; - getBrowser().webNavigation.loadURI(viewSrcUrl, loadFlags); + getBrowser().webNavigation.loadURI(viewSrcUrl, loadFlags, null, null, null); //check the view_source.wrap_long_lines pref and set the menuitem's checked attribute accordingly if (gPrefs) { diff --git a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp index 2aabaf7cc73..e366b990e6b 100644 --- a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp +++ b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp @@ -70,7 +70,6 @@ #include "nsIContentViewer.h" #include "nsIContentViewerEdit.h" #include "nsIWebShell.h" -#include "nsIWebNavigation.h" #include "nsIDocShell.h" #include "nsIWebShellWindow.h" #include "nsIWebBrowserChrome.h" @@ -618,7 +617,11 @@ nsBrowserInstance::LoadUrl(const PRUnichar * urlToLoad) nsCOMPtr webNav(do_QueryInterface(docShell)); // Normal browser. - rv = webNav->LoadURI( urlToLoad, nsIWebNavigation::LOAD_FLAGS_NONE ); + rv = webNav->LoadURI( urlToLoad, // URI string + nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags + nsnull, // Refering URI + nsnull, // Post data + nsnull ); // Extra headers return rv; } diff --git a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp index 8f6cadef411..d83ce3d3c26 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp +++ b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp @@ -587,6 +587,15 @@ nsSHistory::GetCurrentURI(nsIURI** aResultURI) } +NS_IMETHODIMP +nsSHistory::GetReferingURI(nsIURI** aURI) +{ + *aURI = nsnull; + // Not implemented + return NS_OK; +} + + NS_IMETHODIMP nsSHistory::SetSessionHistory(nsISHistory* aSessionHistory) { @@ -604,7 +613,11 @@ nsSHistory::GetSessionHistory(nsISHistory** aSessionHistory) NS_IMETHODIMP -nsSHistory::LoadURI(const PRUnichar* aURI, PRUint32 aLoadFlags) +nsSHistory::LoadURI(const PRUnichar* aURI, + PRUint32 aLoadFlags, + nsIURI* aReferingURI, + nsIInputStream* aPostStream, + nsIInputStream* aExtraHeaderStream) { return NS_OK; } diff --git a/mozilla/xpfe/components/xremote/src/XRemoteService.cpp b/mozilla/xpfe/components/xremote/src/XRemoteService.cpp index eec24cd860e..66c5d8208b8 100644 --- a/mozilla/xpfe/components/xremote/src/XRemoteService.cpp +++ b/mozilla/xpfe/components/xremote/src/XRemoteService.cpp @@ -736,10 +736,14 @@ XRemoteService::OpenURL(nsCString &aArgument, return NS_ERROR_FAILURE; } - rv = webNav->LoadURI(url.get(), nsIWebNavigation::LOAD_FLAGS_NONE); - + rv = webNav->LoadURI(url.get(), + nsIWebNavigation::LOAD_FLAGS_NONE, + nsnull, + nsnull, + nsnull); + } - + return rv; } diff --git a/mozilla/xpfe/global/resources/content/bindings/browser.xml b/mozilla/xpfe/global/resources/content/bindings/browser.xml index 1cd68069360..be75853a3db 100644 --- a/mozilla/xpfe/global/resources/content/bindings/browser.xml +++ b/mozilla/xpfe/global/resources/content/bindings/browser.xml @@ -127,7 +127,7 @@ if (!aURI) aURI = "about:blank"; - this.webNavigation.loadURI(aURI, aFlags); + this.webNavigation.loadURI(aURI, aFlags, null, null, null); ]]>