summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 22:17:06 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 22:17:06 +0000
commitd70539de3df8f214397881727229a7786da9be35 (patch)
treed10df8d461702c8de9b6df045955ee2226edc046 /chrome/browser/search_engines
parent16792a730c621ed32aa53b57d57e6c88e232ea02 (diff)
downloadchromium_src-d70539de3df8f214397881727229a7786da9be35.zip
chromium_src-d70539de3df8f214397881727229a7786da9be35.tar.gz
chromium_src-d70539de3df8f214397881727229a7786da9be35.tar.bz2
Replace std:;wstring with std::string and string16 in locale-name related APIs.
1. Change the locale param to be std::string because they're always ASCII and change call-sites accordingly. 2. Add GetStringFUTF16 to l10n_util. On Windows, they're inline helpers calling the correspondingGetStringF returning wstring while on Mac/Linux, they just return the result of |string16 GetStringF|without converting to wstring. This is part 1 of the fix for issue 8647. Some of newly introduced conversions are temporary and will be removed later (e.g. ASCIIToWide applied to the result of GetApplicationLocale in a few places). Note : this CL will be landed after http://codereview.chromium.org/147038 is landed. BUG=8647 (http://crbug.com/8647) TEST=Pass l10n_util_unittest and other unit tests Review URL: http://codereview.chromium.org/126223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19183 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r--chrome/browser/search_engines/template_url.cc3
-rw-r--r--chrome/browser/search_engines/template_url_unittest.cc2
2 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index e749e89..0c98d48 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -317,7 +317,8 @@ std::wstring TemplateURLRef::ReplaceSearchTerms(
}
case LANGUAGE:
- url.insert(i->index, g_browser_process->GetApplicationLocale());
+ url.insert(i->index,
+ ASCIIToWide(g_browser_process->GetApplicationLocale()));
break;
case SEARCH_TERMS:
diff --git a/chrome/browser/search_engines/template_url_unittest.cc b/chrome/browser/search_engines/template_url_unittest.cc
index 5aa9ce5b..f6825d2 100644
--- a/chrome/browser/search_engines/template_url_unittest.cc
+++ b/chrome/browser/search_engines/template_url_unittest.cc
@@ -238,7 +238,7 @@ TEST_F(TemplateURLTest, ReplaceSearchTerms) {
EXPECT_TRUE(ref.SupportsReplacement());
std::string expected_result = data[i].expected_result;
ReplaceSubstringsAfterOffset(&expected_result, 0, "{language}",
- WideToASCII(g_browser_process->GetApplicationLocale()));
+ g_browser_process->GetApplicationLocale());
GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(turl, L"X",
TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring())));
EXPECT_TRUE(result.is_valid());