summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/tips_handler.cc
diff options
context:
space:
mode:
authormirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 00:00:12 +0000
committermirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 00:00:12 +0000
commit6401e9a9d7552331beac22aca0dfa69532ea4b38 (patch)
tree25d717b46b6895178ab9a2acacdfdca513368ca1 /chrome/browser/dom_ui/tips_handler.cc
parent7dbcfc1c4bd26dacd41130910d8cc2b5a1375b49 (diff)
downloadchromium_src-6401e9a9d7552331beac22aca0dfa69532ea4b38.zip
chromium_src-6401e9a9d7552331beac22aca0dfa69532ea4b38.tar.gz
chromium_src-6401e9a9d7552331beac22aca0dfa69532ea4b38.tar.bz2
Fix tips in OS X to respect system language settings instead of locale.
BUG= http://crbug.com/22727 TEST= Set preferred language to a different setting from the locale in the OS X system settings. Make sure that the language of the tips matches the language setting (which should be the same as that of the Chrome UI). If tips are not available in the Chrome UI language, no tips should be shown. Review URL: http://codereview.chromium.org/258037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28193 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/tips_handler.cc')
-rw-r--r--chrome/browser/dom_ui/tips_handler.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/dom_ui/tips_handler.cc b/chrome/browser/dom_ui/tips_handler.cc
index 888bfa1..68ce766 100644
--- a/chrome/browser/dom_ui/tips_handler.cc
+++ b/chrome/browser/dom_ui/tips_handler.cc
@@ -28,7 +28,7 @@ void TipsHandler::RegisterMessages() {
}
void TipsHandler::HandleGetTips(const Value* content) {
- // List containing the tips to be displayed.
+ // List containing the tips to be displayed.
ListValue list_value;
// Holds the web resource data found in the preferences cache.
@@ -38,15 +38,15 @@ void TipsHandler::HandleGetTips(const Value* content) {
int current_tip_index;
std::string current_tip;
- // If tips are not correct for our locale, do not send. Wait for update.
+ // If tips are not correct for our language, do not send. Wait for update.
// We need to check here because the new tab page calls for tips before
// the tip service starts up.
PrefService* current_prefs = dom_ui_->GetProfile()->GetPrefs();
if (current_prefs->HasPrefPath(prefs::kNTPTipsServer)) {
std::wstring server = current_prefs->GetString(prefs::kNTPTipsServer);
- std::wstring locale = ASCIIToWide(
- g_browser_process->GetApplicationLocale());
- if (!EndsWith(server, locale, false)) {
+ std::wstring tips_language = WebResourceService::GetWebResourceLanguage(
+ current_prefs);
+ if (!EndsWith(server, tips_language, false)) {
dom_ui_->CallJavascriptFunction(L"tips", list_value);
return;
}