summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines/template_url.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 18:31:22 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 18:31:22 +0000
commit7b9f36791bc6caec093a18d790bba7bff03b54d0 (patch)
tree82f4631e118157c872185e830a7afe869b24e713 /chrome/browser/search_engines/template_url.cc
parent94f9a0f686619656ca4ff2b6511179dc2132cc5d (diff)
downloadchromium_src-7b9f36791bc6caec093a18d790bba7bff03b54d0.zip
chromium_src-7b9f36791bc6caec093a18d790bba7bff03b54d0.tar.gz
chromium_src-7b9f36791bc6caec093a18d790bba7bff03b54d0.tar.bz2
Fixes bug where keyword editor would end up prefixing all keyword urls
with "http://" if they didn't have one. This proves problematic as for the google search url we don't have http:// and don't want it. The fix is to only add http:// if the url field is editable. If the url field isn't editable, we know the user hasn't editted it and don't need to try and fix it up. BUG=13282 TEST=see bug, but also make sure you don't run into any other problems with the keyword editor. Review URL: http://codereview.chromium.org/126052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18410 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines/template_url.cc')
-rw-r--r--chrome/browser/search_engines/template_url.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index 9e9a5c9..e749e89 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -230,17 +230,17 @@ void TemplateURLRef::ParseHostAndSearchTermKey() const {
}
}
-GURL TemplateURLRef::ReplaceSearchTerms(
+std::wstring TemplateURLRef::ReplaceSearchTerms(
const TemplateURL& host,
const std::wstring& terms,
int accepted_suggestion,
const std::wstring& original_query_for_suggestion) const {
ParseIfNecessary();
if (!valid_)
- return GURL();
+ return std::wstring();
if (replacements_.empty())
- return GURL(WideToUTF8(parsed_url_));
+ return parsed_url_;
// Encode the search terms so that we know the encoding.
const std::vector<std::string>& encodings = host.input_encodings();
@@ -330,7 +330,7 @@ GURL TemplateURLRef::ReplaceSearchTerms(
}
}
- return GURL(WideToUTF8(url));
+ return url;
}
bool TemplateURLRef::SupportsReplacement() const {