| 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/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/metrics/statistics_recorder.h" | 14 #include "base/metrics/statistics_recorder.h" |
| 15 #include "base/metrics/stats_counters.h" | 15 #include "base/metrics/stats_counters.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/process/memory.h" | 17 #include "base/process/memory.h" |
| 18 #include "base/process/process_handle.h" | 18 #include "base/process/process_handle.h" |
| 19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "chrome/browser/chrome_content_browser_client.h" | 21 #include "chrome/browser/chrome_content_browser_client.h" |
| 22 #include "chrome/browser/defaults.h" | 22 #include "chrome/browser/defaults.h" |
| 23 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_content_client.h" | 24 #include "chrome/common/chrome_content_client.h" |
| 25 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
| 26 #include "chrome/common/chrome_paths_internal.h" | 26 #include "chrome/common/chrome_paths_internal.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/chrome_version_info.h" | 28 #include "chrome/common/chrome_version_info.h" |
| 29 #include "chrome/common/content_settings_pattern.h" |
| 29 #include "chrome/common/crash_keys.h" | 30 #include "chrome/common/crash_keys.h" |
| 30 #include "chrome/common/logging_chrome.h" | 31 #include "chrome/common/logging_chrome.h" |
| 31 #include "chrome/common/profiling.h" | 32 #include "chrome/common/profiling.h" |
| 32 #include "chrome/common/switch_utils.h" | 33 #include "chrome/common/switch_utils.h" |
| 33 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 34 #include "chrome/plugin/chrome_content_plugin_client.h" | 35 #include "chrome/plugin/chrome_content_plugin_client.h" |
| 35 #include "chrome/renderer/chrome_content_renderer_client.h" | 36 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 36 #include "chrome/utility/chrome_content_utility_client.h" | 37 #include "chrome/utility/chrome_content_utility_client.h" |
| 37 #include "components/component_updater/component_updater_paths.h" | 38 #include "components/component_updater/component_updater_paths.h" |
| 38 #include "components/startup_metric_utils/startup_metric_utils.h" | 39 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 39 #include "content/public/common/content_client.h" | 40 #include "content/public/common/content_client.h" |
| 40 #include "content/public/common/content_paths.h" | 41 #include "content/public/common/content_paths.h" |
| 42 #include "extensions/common/constants.h" |
| 41 #include "ui/base/ui_base_switches.h" | 43 #include "ui/base/ui_base_switches.h" |
| 42 | 44 |
| 43 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
| 44 #include <atlbase.h> | 46 #include <atlbase.h> |
| 45 #include <malloc.h> | 47 #include <malloc.h> |
| 46 #include <algorithm> | 48 #include <algorithm> |
| 47 #include "chrome/common/child_process_logging.h" | 49 #include "chrome/common/child_process_logging.h" |
| 48 #include "chrome/common/terminate_on_heap_corruption_experiment_win.h" | 50 #include "chrome/common/terminate_on_heap_corruption_experiment_win.h" |
| 49 #include "sandbox/win/src/sandbox.h" | 51 #include "sandbox/win/src/sandbox.h" |
| 50 #include "ui/base/resource/resource_bundle_win.h" | 52 #include "ui/base/resource/resource_bundle_win.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 #endif | 421 #endif |
| 420 | 422 |
| 421 chrome::RegisterPathProvider(); | 423 chrome::RegisterPathProvider(); |
| 422 #if defined(OS_CHROMEOS) | 424 #if defined(OS_CHROMEOS) |
| 423 chromeos::RegisterPathProvider(); | 425 chromeos::RegisterPathProvider(); |
| 424 #endif | 426 #endif |
| 425 #if !defined(DISABLE_NACL) && defined(OS_LINUX) | 427 #if !defined(DISABLE_NACL) && defined(OS_LINUX) |
| 426 nacl::RegisterPathProvider(); | 428 nacl::RegisterPathProvider(); |
| 427 #endif | 429 #endif |
| 428 | 430 |
| 431 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( |
| 432 extensions::kExtensionScheme); |
| 433 |
| 429 // No support for ANDROID yet as DiagnosticsController needs wchar support. | 434 // No support for ANDROID yet as DiagnosticsController needs wchar support. |
| 430 // TODO(gspencer): That's not true anymore, or at least there are no w-string | 435 // TODO(gspencer): That's not true anymore, or at least there are no w-string |
| 431 // references anymore. Not sure if that means this can be enabled on Android or | 436 // references anymore. Not sure if that means this can be enabled on Android or |
| 432 // not though. As there is no easily accessible command line on Android, I'm | 437 // not though. As there is no easily accessible command line on Android, I'm |
| 433 // not sure this is a big deal. | 438 // not sure this is a big deal. |
| 434 #if !defined(OS_ANDROID) && !defined(CHROME_MULTIPLE_DLL_CHILD) | 439 #if !defined(OS_ANDROID) && !defined(CHROME_MULTIPLE_DLL_CHILD) |
| 435 // If we are in diagnostics mode this is the end of the line: after the | 440 // If we are in diagnostics mode this is the end of the line: after the |
| 436 // diagnostics are run the process will invariably exit. | 441 // diagnostics are run the process will invariably exit. |
| 437 if (command_line.HasSwitch(switches::kDiagnostics)) { | 442 if (command_line.HasSwitch(switches::kDiagnostics)) { |
| 438 diagnostics::DiagnosticsWriter::FormatType format = | 443 diagnostics::DiagnosticsWriter::FormatType format = |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 } | 927 } |
| 923 | 928 |
| 924 content::ContentUtilityClient* | 929 content::ContentUtilityClient* |
| 925 ChromeMainDelegate::CreateContentUtilityClient() { | 930 ChromeMainDelegate::CreateContentUtilityClient() { |
| 926 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 931 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 927 return NULL; | 932 return NULL; |
| 928 #else | 933 #else |
| 929 return g_chrome_content_utility_client.Pointer(); | 934 return g_chrome_content_utility_client.Pointer(); |
| 930 #endif | 935 #endif |
| 931 } | 936 } |
| OLD | NEW |