| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/app_switches.h" |
| 5 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 6 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 7 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 8 #include "base/system_monitor.h" | 9 #include "base/system_monitor.h" |
| 9 #include "chrome/common/child_process.h" | 10 #include "chrome/common/child_process.h" |
| 10 #include "chrome/common/chrome_constants.h" | 11 #include "chrome/common/chrome_constants.h" |
| 11 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/common/extensions/extension_l10n_util.h" |
| 12 #include "chrome/common/logging_chrome.h" | 14 #include "chrome/common/logging_chrome.h" |
| 13 #include "chrome/common/main_function_params.h" | 15 #include "chrome/common/main_function_params.h" |
| 14 #include "chrome/utility/utility_thread.h" | 16 #include "chrome/utility/utility_thread.h" |
| 15 | 17 |
| 16 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
| 17 #include "chrome/common/sandbox_init_wrapper.h" | 19 #include "chrome/common/sandbox_init_wrapper.h" |
| 18 #include "sandbox/src/sandbox.h" | 20 #include "sandbox/src/sandbox.h" |
| 19 #endif | 21 #endif |
| 20 | 22 |
| 21 // Mainline routine for running as the utility process. | 23 // Mainline routine for running as the utility process. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 utility_process.set_main_thread(new UtilityThread()); | 34 utility_process.set_main_thread(new UtilityThread()); |
| 33 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
| 34 sandbox::TargetServices* target_services = | 36 sandbox::TargetServices* target_services = |
| 35 parameters.sandbox_info_.TargetServices(); | 37 parameters.sandbox_info_.TargetServices(); |
| 36 if (!target_services) | 38 if (!target_services) |
| 37 return false; | 39 return false; |
| 38 | 40 |
| 39 target_services->LowerToken(); | 41 target_services->LowerToken(); |
| 40 #endif | 42 #endif |
| 41 | 43 |
| 44 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 45 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); |
| 46 if (!lang.empty()) |
| 47 extension_l10n_util::SetProcessLocale(lang); |
| 48 |
| 42 MessageLoop::current()->Run(); | 49 MessageLoop::current()->Run(); |
| 43 | 50 |
| 44 return 0; | 51 return 0; |
| 45 } | 52 } |
| OLD | NEW |