OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 #if defined(OS_WIN) || defined(OS_MACOSX) | 275 #if defined(OS_WIN) || defined(OS_MACOSX) |
276 // Windows needs resources for the default/null plugin. | 276 // Windows needs resources for the default/null plugin. |
277 // Mac needs them for the plugin process name. | 277 // Mac needs them for the plugin process name. |
278 process_type == switches::kPluginProcess || | 278 process_type == switches::kPluginProcess || |
279 #endif | 279 #endif |
280 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 280 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
281 // The zygote process opens the resources for the renderers. | 281 // The zygote process opens the resources for the renderers. |
282 process_type == switches::kZygoteProcess || | 282 process_type == switches::kZygoteProcess || |
283 #endif | 283 #endif |
284 #if defined(OS_MACOSX) | 284 #if defined(OS_MACOSX) |
285 // Mac needs them to for scrollbar related images. | 285 // Mac needs them to for scrollbar related images and for the sandbox. |
jeremy
2011/11/23 07:02:17
nit: *too
and for the sandbox -> and for sandbox p
jochen (gone - plz use gerrit)
2011/11/23 10:57:28
Done.
| |
286 process_type == switches::kWorkerProcess || | 286 process_type == switches::kWorkerProcess || |
287 process_type == switches::kNaClLoaderProcess || | |
288 process_type == switches::kPpapiPluginProcess || | |
289 process_type == switches::kPpapiBrokerProcess || | |
287 #endif | 290 #endif |
288 process_type == switches::kRendererProcess || | 291 process_type == switches::kRendererProcess || |
289 process_type == switches::kUtilityProcess; | 292 process_type == switches::kUtilityProcess; |
290 } | 293 } |
291 | 294 |
292 #if defined(OS_MACOSX) | 295 #if defined(OS_MACOSX) |
293 // Update the name shown in Activity Monitor so users are less likely to ask | 296 // Update the name shown in Activity Monitor so users are less likely to ask |
294 // why Chrome has so many processes. | 297 // why Chrome has so many processes. |
295 void SetMacProcessName(const CommandLine& command_line) { | 298 void SetMacProcessName(const CommandLine& command_line) { |
296 std::string process_type = | 299 std::string process_type = |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
600 #if defined(OS_WIN) | 603 #if defined(OS_WIN) |
601 // TODO(darin): Kill this once http://crbug.com/52609 is fixed. | 604 // TODO(darin): Kill this once http://crbug.com/52609 is fixed. |
602 ResourceBundle::SetResourcesDataDLL(_AtlBaseModule.GetResourceInstance()); | 605 ResourceBundle::SetResourcesDataDLL(_AtlBaseModule.GetResourceInstance()); |
603 #endif | 606 #endif |
604 | 607 |
605 if (SubprocessNeedsResourceBundle(process_type)) { | 608 if (SubprocessNeedsResourceBundle(process_type)) { |
606 // Initialize ResourceBundle which handles files loaded from external | 609 // Initialize ResourceBundle which handles files loaded from external |
607 // sources. The language should have been passed in to us from the | 610 // sources. The language should have been passed in to us from the |
608 // browser process as a command line flag. | 611 // browser process as a command line flag. |
609 DCHECK(command_line.HasSwitch(switches::kLang) || | 612 DCHECK(command_line.HasSwitch(switches::kLang) || |
610 process_type == switches::kZygoteProcess); | 613 process_type == switches::kZygoteProcess || |
614 process_type == switches::kNaClLoaderProcess || | |
615 process_type == switches::kPpapiBrokerProcess || | |
616 process_type == switches::kPpapiPluginProcess); | |
611 | 617 |
612 // TODO(markusheintz): The command line flag --lang is actually processed | 618 // TODO(markusheintz): The command line flag --lang is actually processed |
613 // by the CommandLinePrefStore, and made available through the PrefService | 619 // by the CommandLinePrefStore, and made available through the PrefService |
614 // via the preference prefs::kApplicationLocale. The browser process uses | 620 // via the preference prefs::kApplicationLocale. The browser process uses |
615 // the --lang flag to pass the value of the PrefService in here. Maybe | 621 // the --lang flag to pass the value of the PrefService in here. Maybe |
616 // this value could be passed in a different way. | 622 // this value could be passed in a different way. |
617 const std::string locale = | 623 const std::string locale = |
618 command_line.GetSwitchValueASCII(switches::kLang); | 624 command_line.GetSwitchValueASCII(switches::kLang); |
619 const std::string loaded_locale = | 625 const std::string loaded_locale = |
620 ResourceBundle::InitSharedInstance(locale); | 626 ResourceBundle::InitSharedInstance(locale); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
731 | 737 |
732 #if defined(USE_LINUX_BREAKPAD) | 738 #if defined(USE_LINUX_BREAKPAD) |
733 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets | 739 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets |
734 // this up for the browser process in a different manner. | 740 // this up for the browser process in a different manner. |
735 InitCrashReporter(); | 741 InitCrashReporter(); |
736 #endif | 742 #endif |
737 | 743 |
738 InitializeChromeContentClient(process_type); | 744 InitializeChromeContentClient(process_type); |
739 } | 745 } |
740 #endif // OS_MACOSX | 746 #endif // OS_MACOSX |
OLD | NEW |