summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-17 15:51:22 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-17 15:51:22 +0000
commit1b4200f7c79bd618df2582bd46410937dfd59323 (patch)
tree7b7c1ed50ca6c7f671ca04c8677c1c59750a3549
parent7ee3f099cdce770029d0eea81bbd36bd56a279ec (diff)
downloadchromium_src-1b4200f7c79bd618df2582bd46410937dfd59323.zip
chromium_src-1b4200f7c79bd618df2582bd46410937dfd59323.tar.gz
chromium_src-1b4200f7c79bd618df2582bd46410937dfd59323.tar.bz2
EscapeQueryParamValue differs from encodeURIComponent in that it doesn't escape spaces, so we have to do some manual fiddling to make searches that have come from the New Tab Page work (see GetHistoryURLWithSearchText).
BUG=9940 TEST=Verify that searches from the new tab page and from the history page result in the same search query appearing in the history results page. Review URL: http://codereview.chromium.org/67249 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13938 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/history.html9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/resources/history.html b/chrome/browser/resources/history.html
index 8c5b099..ff1a4d5 100644
--- a/chrome/browser/resources/history.html
+++ b/chrome/browser/resources/history.html
@@ -651,7 +651,7 @@ PageState.prototype.getHashData = function() {
for (var i = 0; i < hashSplit.length; i++) {
var pair = hashSplit[i].split("=");
if (pair.length > 1) {
- result[pair[0]] = decodeURIComponent(pair[1]);
+ result[pair[0]] = decodeURIComponent(pair[1].replace(/\+/g, ' '));
}
}
@@ -668,10 +668,9 @@ PageState.prototype.getHashData = function() {
PageState.prototype.setUIState = function(term, page) {
// Make sure the form looks pretty.
document.forms[0].term.value = term;
-
- var hash = PageState.getHashString(term, page);
- if (window.location.hash.substr(1) != hash) {
- window.location.hash = hash;
+ var currentHash = this.getHashData();
+ if (currentHash.q != term || currentHash.p != page) {
+ window.location.hash = PageState.getHashString(term, page);
}
}