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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/debug/debugger.h" 6 #include "base/debug/debugger.h"
7 #include "base/i18n/rtl.h"
7 #include "base/message_loop.h" 8 #include "base/message_loop.h"
8 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
9 #include "build/build_config.h" 10 #include "build/build_config.h"
10 #include "content/common/child_process.h" 11 #include "content/common/child_process.h"
11 #include "content/ppapi_plugin/ppapi_thread.h" 12 #include "content/ppapi_plugin/ppapi_thread.h"
12 #include "content/public/common/content_switches.h" 13 #include "content/public/common/content_switches.h"
13 #include "content/public/common/main_function_params.h" 14 #include "content/public/common/main_function_params.h"
15 #include "ui/base/ui_base_switches.h"
raymes 2012/08/03 22:05:17 Wrong order.
14 #include "ppapi/proxy/proxy_module.h" 16 #include "ppapi/proxy/proxy_module.h"
15 17
16 #if defined(OS_WIN) 18 #if defined(OS_WIN)
17 #include "sandbox/win/src/sandbox.h" 19 #include "sandbox/win/src/sandbox.h"
18 #endif 20 #endif
19 21
20 #if defined(OS_LINUX) 22 #if defined(OS_LINUX)
21 #include "content/public/common/sandbox_init.h" 23 #include "content/public/common/sandbox_init.h"
22 #endif 24 #endif
23 25
(...skipping 14 matching lines...) Expand all
38 // If |g_target_services| is not null this process is sandboxed. One side 40 // If |g_target_services| is not null this process is sandboxed. One side
39 // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger() 41 // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger()
40 // does. 42 // does.
41 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { 43 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) {
42 if (g_target_services) 44 if (g_target_services)
43 base::debug::WaitForDebugger(2*60, false); 45 base::debug::WaitForDebugger(2*60, false);
44 else 46 else
45 ChildProcess::WaitForDebugger("Ppapi"); 47 ChildProcess::WaitForDebugger("Ppapi");
46 } 48 }
47 49
50 // Set the default locale to be the current UI language. WebKit uses ICU's
51 // default locale for some font settings (especially switching between
52 // Japanese and Chinese fonts for the same characters).
53 if (command_line.HasSwitch(switches::kLang)) {
54 std::string locale = command_line.GetSwitchValueASCII(switches::kLang);
55 base::i18n::SetICUDefaultLocale(locale);
56 }
57
48 MessageLoop main_message_loop; 58 MessageLoop main_message_loop;
49 base::PlatformThread::SetName("CrPPAPIMain"); 59 base::PlatformThread::SetName("CrPPAPIMain");
50 60
51 #if defined(OS_LINUX) 61 #if defined(OS_LINUX)
52 content::InitializeSandbox(); 62 content::InitializeSandbox();
53 #endif 63 #endif
54 64
55 ChildProcess ppapi_process; 65 ChildProcess ppapi_process;
56 ppapi_process.set_main_thread( 66 ppapi_process.set_main_thread(
57 new PpapiThread(parameters.command_line, false)); // Not a broker. 67 new PpapiThread(parameters.command_line, false)); // Not a broker.
58 68
59 main_message_loop.Run(); 69 main_message_loop.Run();
60 return 0; 70 return 0;
61 } 71 }
OLDNEW
« 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