Bug 724841 - Retain case when sending location bar text to search engine service r=bz

This commit is contained in:
Eric Wong 2012-04-28 18:39:14 -07:00
parent 2959b5c867
commit 2974faa0ea
2 changed files with 33 additions and 21 deletions

View File

@ -3896,6 +3896,10 @@ nsDocShell::LoadURI(const PRUnichar * aURI,
rv = LoadURI(uri, loadInfo, extraFlags, true); rv = LoadURI(uri, loadInfo, extraFlags, true);
// Save URI string in case it's needed later when
// sending to search engine service in EndPageLoad()
mOriginalUriString = uriString;
return rv; return rv;
} }
@ -6355,6 +6359,11 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
if (keywordsEnabled && (kNotFound == dotLoc)) { if (keywordsEnabled && (kNotFound == dotLoc)) {
// only send non-qualified hosts to the keyword server // only send non-qualified hosts to the keyword server
if (!mOriginalUriString.IsEmpty()) {
sURIFixup->KeywordToURI(mOriginalUriString,
getter_AddRefs(newURI));
}
else {
// //
// If this string was passed through nsStandardURL by // If this string was passed through nsStandardURL by
// chance, then it may have been converted from UTF-8 to // chance, then it may have been converted from UTF-8 to
@ -6376,6 +6385,7 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
getter_AddRefs(newURI)); getter_AddRefs(newURI));
else else
sURIFixup->KeywordToURI(host, getter_AddRefs(newURI)); sURIFixup->KeywordToURI(host, getter_AddRefs(newURI));
}
} // end keywordsEnabled } // end keywordsEnabled
} }
@ -8070,6 +8080,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
nsIRequest** aRequest) nsIRequest** aRequest)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
mOriginalUriString.Truncate();
#ifdef PR_LOGGING #ifdef PR_LOGGING
if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) { if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {

View File

@ -849,6 +849,7 @@ private:
nsCOMPtr<nsIAtom> mParentCharset; nsCOMPtr<nsIAtom> mParentCharset;
nsTObserverArray<nsWeakPtr> mPrivacyObservers; nsTObserverArray<nsWeakPtr> mPrivacyObservers;
PRInt32 mParentCharsetSource; PRInt32 mParentCharsetSource;
nsCString mOriginalUriString;
#ifdef DEBUG #ifdef DEBUG
// We're counting the number of |nsDocShells| to help find leaks // We're counting the number of |nsDocShells| to help find leaks