summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_resource/web_resource_service.cc
diff options
context:
space:
mode:
authorthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 16:25:04 +0000
committerthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-19 16:25:04 +0000
commit9986ee16343028edb452fe235ac6a8fca5ee12f5 (patch)
tree8f173eb25a6e7b8d10370e38e8dd60ea5d16da94 /chrome/browser/web_resource/web_resource_service.cc
parent877161b02f6703bb5694a395de9e8cd4e8a93a3e (diff)
downloadchromium_src-9986ee16343028edb452fe235ac6a8fca5ee12f5.zip
chromium_src-9986ee16343028edb452fe235ac6a8fca5ee12f5.tar.gz
chromium_src-9986ee16343028edb452fe235ac6a8fca5ee12f5.tar.bz2
Mac language/locale cleanup
- Effectively revert revision 28193 (http://codereview.chromium.org/258037), this makes Mac match the other platform for what at it's core is used for the chrome concept of locale. - For the ApplicationLanguage, the browser will end up with what Cocoa picks (same as before) - All other process types will honor the language they got on the command line when starting up. - When asked the apps language, have the same side effect as Windows and Linux has of pushing the language through to ICU also (so dates format right, etc.) - During browser startup, if someone passed a language, bail because Mac can't support that. TEST=The tips on the NTP and the dates on the history page are in the same language at the UI. BUG=26856 BUG=22727 Review URL: http://codereview.chromium.org/399086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_resource/web_resource_service.cc')
-rw-r--r--chrome/browser/web_resource/web_resource_service.cc21
1 files changed, 3 insertions, 18 deletions
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc
index c26c8b1..c4ffa47 100644
--- a/chrome/browser/web_resource/web_resource_service.cc
+++ b/chrome/browser/web_resource/web_resource_service.cc
@@ -211,19 +211,19 @@ void WebResourceService::Init() {
resource_dispatcher_host_ = g_browser_process->resource_dispatcher_host();
web_resource_fetcher_ = new WebResourceFetcher(this);
prefs_->RegisterStringPref(prefs::kNTPTipsCacheUpdate, L"0");
- std::wstring language = WebResourceService::GetWebResourceLanguage(prefs_);
+ std::wstring locale = ASCIIToWide(g_browser_process->GetApplicationLocale());
if (prefs_->HasPrefPath(prefs::kNTPTipsServer)) {
web_resource_server_ = prefs_->GetString(prefs::kNTPTipsServer);
// If we are in the correct locale, initialization is done.
- if (EndsWith(web_resource_server_, language, false))
+ if (EndsWith(web_resource_server_, locale, false))
return;
}
// If we have not yet set a server, or if the tips server is set to the wrong
// locale, reset the server and force an immediate update of tips.
web_resource_server_ = kDefaultResourceServer;
- web_resource_server_.append(language);
+ web_resource_server_.append(locale);
prefs_->SetString(prefs::kNTPTipsCacheUpdate, L"");
}
@@ -302,18 +302,3 @@ void WebResourceService::UpdateResourceCache(const std::string& json_data) {
DoubleToWString(base::Time::Now().ToDoubleT()));
prefs_->SetString(prefs::kNTPTipsServer, web_resource_server_);
}
-
-// static
-std::wstring WebResourceService::GetWebResourceLanguage(PrefService* prefs) {
-#if defined OS_MACOSX
- // OS X derives the language for the Chrome UI from the list of accepted
- // languages, which can be different from the locale.
- std::wstring languageList = prefs->GetString(prefs::kAcceptLanguages);
- int pos = languageList.find(L",");
- pos = pos >= 0 ? pos : languageList.length();
- return languageList.substr(0, pos);
-#else
- return ASCIIToWide(g_browser_process->GetApplicationLocale());
-#endif
-}
-