Call to GetCurrentURI modified to new style. b=46847, r=valeski, a=valeski

git-svn-id: svn://10.0.0.236/trunk@77612 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie 2000-08-30 11:37:06 +00:00
parent 3173294e22
commit 5ff2709c4c
5 changed files with 19 additions and 11 deletions

View File

@ -75,6 +75,7 @@
#include "nsIWebShell.h"
#include "nsIDocShell.h"
#include "nsIWebNavigation.h"
#include "nsIDocument.h"
#include "nsIDocumentObserver.h"
#include "nsIHTMLDocument.h"
@ -4179,7 +4180,8 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
// first get our baseURI
nsCOMPtr<nsIURI> baseURI;
rv = docShell->GetCurrentURI(getter_AddRefs(baseURI));
nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(docShell);
rv = webNav->GetCurrentURI(getter_AddRefs(baseURI));
if (NS_FAILED(rv)) return rv;
PRInt32 millis = -1;
@ -4275,7 +4277,8 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIURI> baseURI;
rv = docShell->GetCurrentURI(getter_AddRefs(baseURI));
nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(docShell);
rv = webNav->GetCurrentURI(getter_AddRefs(baseURI));
if (NS_FAILED(rv)) return rv;
rv = cookieServ->SetCookieString(baseURI, result);

View File

@ -333,9 +333,10 @@ LocationImpl::GetHref(nsAWritableString& aHref)
{
nsresult result = NS_OK;
if (mDocShell) {
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mDocShell));
if (webNav) {
nsCOMPtr<nsIURI> uri;
result = mDocShell->GetCurrentURI(getter_AddRefs(uri));
result = webNav->GetCurrentURI(getter_AddRefs(uri));
if (NS_SUCCEEDED(result) && uri) {
nsXPIDLCString uriString;
result = uri->GetSpec(getter_Copies(uriString));

View File

@ -2035,10 +2035,10 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_LocationURL(BSTR __RPC_FAR *Locat
nsCOMPtr<nsIURI> uri;
// Get the current url from the browser
nsCOMPtr<nsIDocShell> rootDocShell = do_GetInterface(mWebBrowser);
if (rootDocShell)
nsCOMPtr<nsIWebNavigation> browserAsNav = do_QueryInterface(mWebBrowser);
if (browserAsNav)
{
rootDocShell->GetCurrentURI(getter_AddRefs(uri));
browserAsNav->GetCurrentURI(getter_AddRefs(uri));
}
if (uri)

View File

@ -75,6 +75,7 @@
#include "nsIWebShell.h"
#include "nsIDocShell.h"
#include "nsIWebNavigation.h"
#include "nsIDocument.h"
#include "nsIDocumentObserver.h"
#include "nsIHTMLDocument.h"
@ -4179,7 +4180,8 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
// first get our baseURI
nsCOMPtr<nsIURI> baseURI;
rv = docShell->GetCurrentURI(getter_AddRefs(baseURI));
nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(docShell);
rv = webNav->GetCurrentURI(getter_AddRefs(baseURI));
if (NS_FAILED(rv)) return rv;
PRInt32 millis = -1;
@ -4275,7 +4277,8 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIURI> baseURI;
rv = docShell->GetCurrentURI(getter_AddRefs(baseURI));
nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(docShell);
rv = webNav->GetCurrentURI(getter_AddRefs(baseURI));
if (NS_FAILED(rv)) return rv;
rv = cookieServ->SetCookieString(baseURI, result);

View File

@ -40,7 +40,6 @@
/// Unsorted Includes
#include "nsIWebShell.h"
#include "nsIMarkupDocumentViewer.h"
#include "pratom.h"
#include "prprf.h"
@ -59,6 +58,7 @@
#include "nsIContentViewer.h"
#include "nsIContentViewerEdit.h"
#include "nsIWebShell.h"
#include "nsIWebNavigation.h"
#include "nsIDocShell.h"
#include "nsIWebShellWindow.h"
#include "nsIWebBrowserChrome.h"
@ -650,7 +650,8 @@ nsBrowserInstance::LoadInitialPage(void)
// Examine content URL.
if ( GetContentAreaDocShell() ) {
nsCOMPtr<nsIURI> uri;
rv = GetContentAreaDocShell()->GetCurrentURI(getter_AddRefs(uri));
nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(GetContentAreaDocShell());
rv = webNav->GetCurrentURI(getter_AddRefs(uri));
nsXPIDLCString spec;
if (uri)
rv = uri->GetSpec(getter_Copies(spec));