Camino only - Don't show wyciwyg URLs in location bar. Patch by smorgan <stuart.morgan@alumni.case.edu> r=hwaara sr=pink b=306396

This commit is contained in:
stridey%gmail.com 2006-10-25 19:02:32 +00:00
Родитель a723cfe070
Коммит c05e66e7a3
4 изменённых файлов: 32 добавлений и 4 удалений

Просмотреть файл

@ -135,3 +135,6 @@ pref("browser.link.open_newwindow.restriction", 2);
// enable popup blocking
pref("dom.disable_open_during_load", true);
// don't hide user:pass when fixing up URIs
pref("browser.fixup.hide_user_pass", false);

Просмотреть файл

@ -41,6 +41,7 @@
#include "nsDownloadListener.h"
#include "nsIURIFixup.h"
#include "nsIWebProgress.h"
#include "nsIFileURL.h"
#include "netCore.h"
@ -312,8 +313,14 @@ nsDownloadListener::InitDialog()
spec.Append(hostport);
spec.Append(path);
}
else
mURI->GetSpec(spec);
else {
nsCOMPtr<nsIURI> exposableURI;
nsCOMPtr<nsIURIFixup> fixup(do_GetService("@mozilla.org/docshell/urifixup;1"));
if (fixup && NS_SUCCEEDED(fixup->CreateExposableURI(mURI, getter_AddRefs(exposableURI))) && exposableURI)
exposableURI->GetSpec(spec);
else
mURI->GetSpec(spec);
}
[mDownloadDisplay setSourceURL: [NSString stringWithUTF8String:spec.get()]];
}

Просмотреть файл

@ -46,6 +46,7 @@
#include "nsIWebNavigation.h"
#include "nsIWebProgress.h"
#include "nsIURI.h"
#include "nsIURIFixup.h"
#include "nsIDOMElement.h"
#include "nsIDOMWindow.h"
#include "nsIDOMDocument.h"
@ -708,7 +709,13 @@ CHBrowserListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aR
}
nsCAutoString spec;
aLocation->GetSpec(spec);
nsCOMPtr<nsIURI> exposableLocation;
nsCOMPtr<nsIURIFixup> fixup(do_GetService("@mozilla.org/docshell/urifixup;1"));
if (fixup && NS_SUCCEEDED(fixup->CreateExposableURI(aLocation, getter_AddRefs(exposableLocation))) && exposableLocation)
exposableLocation->GetSpec(spec);
else
aLocation->GetSpec(spec);
NSString* str = [NSString stringWithUTF8String:spec.get()];
NSEnumerator* enumerator = [mListeners objectEnumerator];

Просмотреть файл

@ -51,6 +51,7 @@
#include "nsIDocCharset.h"
#include "nsIURI.h"
#include "nsIURIFixup.h"
#include "nsIDocument.h"
#include "nsIDOMWindow.h"
#include "nsPIDOMWindow.h"
@ -537,6 +538,10 @@ const long NSFindPanelActionSetFindString = 7;
browserSetup->SetProperty(property, value);
}
// Gets the current URI in fixed-up form, suitable for display to the user.
// In the case of wyciwyg: URIs, this will not be the actual URI of the page
// according to gecko.
//
// should we be using the window.location URL instead? see nsIDOMLocation.h
- (NSString*)getCurrentURI
{
@ -550,7 +555,13 @@ const long NSFindPanelActionSetFindString = 7;
return @"";
nsCAutoString spec;
uri->GetSpec(spec);
nsCOMPtr<nsIURI> exposableURI;
nsCOMPtr<nsIURIFixup> fixup(do_GetService("@mozilla.org/docshell/urifixup;1"));
if (fixup && NS_SUCCEEDED(fixup->CreateExposableURI(uri, getter_AddRefs(exposableURI))) && exposableURI)
exposableURI->GetSpec(spec);
else
uri->GetSpec(spec);
return [NSString stringWithUTF8String:spec.get()];
}