summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines/template_url.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 20:39:41 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 20:39:41 +0000
commit48f619d8bd9a264f14ce4b62a935e05df015432b (patch)
tree6b62dab3f626a126ed41a80960f3dc9a417cf550 /chrome/browser/search_engines/template_url.cc
parent27773dfa39409674a0c319b527950369d2e82b75 (diff)
downloadchromium_src-48f619d8bd9a264f14ce4b62a935e05df015432b.zip
chromium_src-48f619d8bd9a264f14ce4b62a935e05df015432b.tar.gz
chromium_src-48f619d8bd9a264f14ce4b62a935e05df015432b.tar.bz2
Remove std::wstring from most of net/base/escape.h.
I left the one API because based on the comment, it should eventually be removed. Updated the callers to use UTF16ToWideHack until more work can be done to remove std::wstring. I also updated net/base/escape_unittest.cc to use the same hack until a proper solution can be coded. Original patch submission here: http://codereview.chromium.org/402085 Patch by Patrick Scott (phanna@android.com) R=darin BUG=23581 TEST=escape_unittest Review URL: http://codereview.chromium.org/452015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines/template_url.cc')
-rw-r--r--chrome/browser/search_engines/template_url.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index 3febf96..82bec3b 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -248,13 +248,14 @@ std::wstring TemplateURLRef::ReplaceSearchTerms(
// Encode the search terms so that we know the encoding.
const std::vector<std::string>& encodings = host.input_encodings();
- std::wstring encoded_terms;
- std::wstring encoded_original_query;
+ string16 encoded_terms;
+ string16 encoded_original_query;
std::wstring input_encoding;
for (size_t i = 0; i < encodings.size(); ++i) {
- if (EscapeQueryParamValue(terms, encodings[i].c_str(), &encoded_terms)) {
+ if (EscapeQueryParamValue(WideToUTF16Hack(terms),
+ encodings[i].c_str(), &encoded_terms)) {
if (!original_query_for_suggestion.empty()) {
- EscapeQueryParamValue(original_query_for_suggestion,
+ EscapeQueryParamValue(WideToUTF16Hack(original_query_for_suggestion),
encodings[i].c_str(), &encoded_original_query);
}
input_encoding = ASCIIToWide(encodings[i]);
@@ -262,10 +263,11 @@ std::wstring TemplateURLRef::ReplaceSearchTerms(
}
}
if (input_encoding.empty()) {
- encoded_terms = EscapeQueryParamValueUTF8(terms);
+ encoded_terms = WideToUTF16Hack(EscapeQueryParamValueUTF8(terms));
if (!original_query_for_suggestion.empty()) {
encoded_original_query =
- EscapeQueryParamValueUTF8(original_query_for_suggestion);
+ WideToUTF16Hack(
+ EscapeQueryParamValueUTF8(original_query_for_suggestion));
}
input_encoding = L"UTF-8";
}
@@ -298,7 +300,8 @@ std::wstring TemplateURLRef::ReplaceSearchTerms(
case GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION:
if (accepted_suggestion >= 0)
- url.insert(i->index, L"oq=" + encoded_original_query + L"&");
+ url.insert(i->index, L"oq=" +
+ UTF16ToWideHack(encoded_original_query) + L"&");
break;
case GOOGLE_RLZ: {
@@ -333,7 +336,7 @@ std::wstring TemplateURLRef::ReplaceSearchTerms(
break;
case SEARCH_TERMS:
- url.insert(i->index, encoded_terms);
+ url.insert(i->index, UTF16ToWideHack(encoded_terms));
break;
default: