Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: content/ppapi_plugin/ppapi_plugin_main.cc

Issue 10853007: Set the default locale for ICU in the PPAPI process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_plugin_main.cc
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc
index 4550e90637b316deffed870d0fb319b70c86e07b..734c8dc693433ff74827ccaa63629733189dbc58 100644
--- a/content/ppapi_plugin/ppapi_plugin_main.cc
+++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -4,6 +4,7 @@
#include "base/command_line.h"
#include "base/debug/debugger.h"
+#include "base/i18n/rtl.h"
#include "base/message_loop.h"
#include "base/threading/platform_thread.h"
#include "build/build_config.h"
@@ -11,6 +12,7 @@
#include "content/ppapi_plugin/ppapi_thread.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
+#include "ui/base/ui_base_switches.h"
raymes 2012/08/03 22:05:17 Wrong order.
#include "ppapi/proxy/proxy_module.h"
#if defined(OS_WIN)
@@ -45,6 +47,14 @@ int PpapiPluginMain(const content::MainFunctionParams& parameters) {
ChildProcess::WaitForDebugger("Ppapi");
}
+ // Set the default locale to be the current UI language. WebKit uses ICU's
+ // default locale for some font settings (especially switching between
+ // Japanese and Chinese fonts for the same characters).
+ if (command_line.HasSwitch(switches::kLang)) {
+ std::string locale = command_line.GetSwitchValueASCII(switches::kLang);
+ base::i18n::SetICUDefaultLocale(locale);
+ }
+
MessageLoop main_message_loop;
base::PlatformThread::SetName("CrPPAPIMain");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698