OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
8 // abstraction. | 8 // abstraction. |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 #endif | 711 #endif |
712 } | 712 } |
713 #endif // NDEBUG | 713 #endif // NDEBUG |
714 | 714 |
715 if (SubprocessNeedsResourceBundle(process_type)) { | 715 if (SubprocessNeedsResourceBundle(process_type)) { |
716 // Initialize ResourceBundle which handles files loaded from external | 716 // Initialize ResourceBundle which handles files loaded from external |
717 // sources. The language should have been passed in to us from the | 717 // sources. The language should have been passed in to us from the |
718 // browser process as a command line flag. | 718 // browser process as a command line flag. |
719 DCHECK(parsed_command_line.HasSwitch(switches::kLang) || | 719 DCHECK(parsed_command_line.HasSwitch(switches::kLang) || |
720 process_type == switches::kZygoteProcess); | 720 process_type == switches::kZygoteProcess); |
721 ResourceBundle::InitSharedInstance(std::wstring()); | 721 |
| 722 // TODO(markusheintz): The command line flag --lang is actually processed |
| 723 // by the CommandLinePrefStore, and made available through the PrefService |
| 724 // via the preference prefs::kApplicationLocale. The browser process uses |
| 725 // the --lang flag to passe the value of the PrefService in here. Maybe this |
| 726 // value could be passed in a different way. |
| 727 ResourceBundle::InitSharedInstance( |
| 728 parsed_command_line.GetSwitchValue(switches::kLang)); |
722 | 729 |
723 #if defined(OS_MACOSX) | 730 #if defined(OS_MACOSX) |
724 // Update the process name (need resources to get the strings, so | 731 // Update the process name (need resources to get the strings, so |
725 // only do this when ResourcesBundle has been initialized). | 732 // only do this when ResourcesBundle has been initialized). |
726 SetMacProcessName(process_type); | 733 SetMacProcessName(process_type); |
727 #endif // defined(OS_MACOSX) | 734 #endif // defined(OS_MACOSX) |
728 } | 735 } |
729 | 736 |
730 if (!process_type.empty()) | 737 if (!process_type.empty()) |
731 CommonSubprocessInit(); | 738 CommonSubprocessInit(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 | 890 |
884 logging::CleanupChromeLogging(); | 891 logging::CleanupChromeLogging(); |
885 | 892 |
886 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 893 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
887 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 894 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
888 DestructCrashReporter(); | 895 DestructCrashReporter(); |
889 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 896 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
890 | 897 |
891 return rv; | 898 return rv; |
892 } | 899 } |
OLD | NEW |