summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-19 19:50:48 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-19 19:50:48 +0000
commitd90de1c0fdaa6cb12b0d4a964ec7d9ff0a71e4d3 (patch)
tree09ff2947df75f74f6d26e8ba0390b2de13431553 /app
parentea0a1ff0dc20845fb28d172d28724420e60a7fb1 (diff)
downloadchromium_src-d90de1c0fdaa6cb12b0d4a964ec7d9ff0a71e4d3.zip
chromium_src-d90de1c0fdaa6cb12b0d4a964ec7d9ff0a71e4d3.tar.gz
chromium_src-d90de1c0fdaa6cb12b0d4a964ec7d9ff0a71e4d3.tar.bz2
Adds the application locale police that allows to enforce the kApplicationLocale preference.
bug=44504 test=none Review URL: http://codereview.chromium.org/2809058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/l10n_util.cc26
1 files changed, 5 insertions, 21 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc
index e50bbb8..9da76fc 100644
--- a/app/l10n_util.cc
+++ b/app/l10n_util.cc
@@ -381,14 +381,7 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) {
// to renderer and plugin processes so they know what language the parent
// process decided to use.
#if defined(OS_WIN)
- // First, check to see if there's a --lang flag.
- const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
- const std::string& lang_arg =
- parsed_command_line.GetSwitchValueASCII(switches::kLang);
- if (!lang_arg.empty())
- candidates.push_back(lang_arg);
-
- // Second, try user prefs.
+ // First, try the preference value.
if (!pref_locale.empty())
candidates.push_back(WideToASCII(pref_locale));
@@ -396,15 +389,7 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) {
candidates.push_back(system_locale);
#elif defined(OS_CHROMEOS)
- // We use --lang on chroemos for debugging/troubleshooting purpose.
- const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
- const std::string& lang_arg =
- parsed_command_line.GetSwitchValueASCII(switches::kLang);
- if (!lang_arg.empty())
- candidates.push_back(lang_arg);
-
- // On ChromeOS, try user prefs. This restores the locale used by the
- // previous run of the OS.
+ // On ChromeOS, use the application locale preference.
if (!pref_locale.empty())
candidates.push_back(WideToASCII(pref_locale));
@@ -445,12 +430,11 @@ std::string GetApplicationLocale(const std::wstring& pref_locale) {
#else // !defined(OS_MACOSX)
- // Use any override (Cocoa for the browser), otherwise use the command line
- // argument.
+ // Use any override (Cocoa for the browser), otherwise use the preference
+ // passed to the function.
std::string app_locale = l10n_util::GetLocaleOverride();
if (app_locale.empty()) {
- const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
- app_locale = parsed_command_line.GetSwitchValueASCII(switches::kLang);
+ app_locale = WideToASCII(pref_locale);
}
// The above should handle all of the cases Chrome normally hits, but for some