OLD | NEW |
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 "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/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "chrome/common/chrome_paths_internal.h" | 23 #include "chrome/common/chrome_paths_internal.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/chrome_version_info.h" | 25 #include "chrome/common/chrome_version_info.h" |
26 #include "chrome/common/logging_chrome.h" | 26 #include "chrome/common/logging_chrome.h" |
27 #include "chrome/common/profiling.h" | 27 #include "chrome/common/profiling.h" |
28 #include "chrome/common/startup_metric_utils.h" | 28 #include "chrome/common/startup_metric_utils.h" |
29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
30 #include "chrome/plugin/chrome_content_plugin_client.h" | 30 #include "chrome/plugin/chrome_content_plugin_client.h" |
31 #include "chrome/renderer/chrome_content_renderer_client.h" | 31 #include "chrome/renderer/chrome_content_renderer_client.h" |
32 #include "chrome/utility/chrome_content_utility_client.h" | 32 #include "chrome/utility/chrome_content_utility_client.h" |
| 33 #include "components/nacl/common/nacl_switches.h" |
33 #include "content/public/common/content_client.h" | 34 #include "content/public/common/content_client.h" |
34 #include "content/public/common/content_paths.h" | 35 #include "content/public/common/content_paths.h" |
35 #include "ui/base/ui_base_switches.h" | 36 #include "ui/base/ui_base_switches.h" |
36 | 37 |
37 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
38 #include <algorithm> | 39 #include <algorithm> |
39 #include <atlbase.h> | 40 #include <atlbase.h> |
40 #include <malloc.h> | 41 #include <malloc.h> |
41 #include "base/strings/string_util.h" | 42 #include "base/strings/string_util.h" |
42 #include "sandbox/win/src/sandbox.h" | 43 #include "sandbox/win/src/sandbox.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 522 |
522 #if defined(OS_WIN) | 523 #if defined(OS_WIN) |
523 // TODO(darin): Kill this once http://crbug.com/52609 is fixed. | 524 // TODO(darin): Kill this once http://crbug.com/52609 is fixed. |
524 ui::SetResourcesDataDLL(_AtlBaseModule.GetResourceInstance()); | 525 ui::SetResourcesDataDLL(_AtlBaseModule.GetResourceInstance()); |
525 #endif | 526 #endif |
526 | 527 |
527 if (SubprocessNeedsResourceBundle(process_type)) { | 528 if (SubprocessNeedsResourceBundle(process_type)) { |
528 // Initialize ResourceBundle which handles files loaded from external | 529 // Initialize ResourceBundle which handles files loaded from external |
529 // sources. The language should have been passed in to us from the | 530 // sources. The language should have been passed in to us from the |
530 // browser process as a command line flag. | 531 // browser process as a command line flag. |
| 532 #if defined(DISABLE_NACL) |
| 533 DCHECK(command_line.HasSwitch(switches::kLang) || |
| 534 process_type == switches::kZygoteProcess || |
| 535 process_type == switches::kGpuProcess || |
| 536 process_type == switches::kPpapiBrokerProcess || |
| 537 process_type == switches::kPpapiPluginProcess); |
| 538 #else |
531 DCHECK(command_line.HasSwitch(switches::kLang) || | 539 DCHECK(command_line.HasSwitch(switches::kLang) || |
532 process_type == switches::kZygoteProcess || | 540 process_type == switches::kZygoteProcess || |
533 process_type == switches::kGpuProcess || | 541 process_type == switches::kGpuProcess || |
534 process_type == switches::kNaClLoaderProcess || | 542 process_type == switches::kNaClLoaderProcess || |
535 process_type == switches::kPpapiBrokerProcess || | 543 process_type == switches::kPpapiBrokerProcess || |
536 process_type == switches::kPpapiPluginProcess); | 544 process_type == switches::kPpapiPluginProcess); |
| 545 #endif |
537 | 546 |
538 // TODO(markusheintz): The command line flag --lang is actually processed | 547 // TODO(markusheintz): The command line flag --lang is actually processed |
539 // by the CommandLinePrefStore, and made available through the PrefService | 548 // by the CommandLinePrefStore, and made available through the PrefService |
540 // via the preference prefs::kApplicationLocale. The browser process uses | 549 // via the preference prefs::kApplicationLocale. The browser process uses |
541 // the --lang flag to pass the value of the PrefService in here. Maybe | 550 // the --lang flag to pass the value of the PrefService in here. Maybe |
542 // this value could be passed in a different way. | 551 // this value could be passed in a different way. |
543 const std::string locale = | 552 const std::string locale = |
544 command_line.GetSwitchValueASCII(switches::kLang); | 553 command_line.GetSwitchValueASCII(switches::kLang); |
545 #if defined(OS_ANDROID) | 554 #if defined(OS_ANDROID) |
546 // The renderer sandbox prevents us from accessing our .pak files directly. | 555 // The renderer sandbox prevents us from accessing our .pak files directly. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 | 722 |
714 content::ContentRendererClient* | 723 content::ContentRendererClient* |
715 ChromeMainDelegate::CreateContentRendererClient() { | 724 ChromeMainDelegate::CreateContentRendererClient() { |
716 return &g_chrome_content_renderer_client.Get(); | 725 return &g_chrome_content_renderer_client.Get(); |
717 } | 726 } |
718 | 727 |
719 content::ContentUtilityClient* | 728 content::ContentUtilityClient* |
720 ChromeMainDelegate::CreateContentUtilityClient() { | 729 ChromeMainDelegate::CreateContentUtilityClient() { |
721 return &g_chrome_content_utility_client.Get(); | 730 return &g_chrome_content_utility_client.Get(); |
722 } | 731 } |
OLD | NEW |