| 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/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 #include "components/error_page/common/error_page_switches.h" | 123 #include "components/error_page/common/error_page_switches.h" |
| 124 #include "components/google/core/browser/google_util.h" | 124 #include "components/google/core/browser/google_util.h" |
| 125 #include "components/metrics/client_info.h" | 125 #include "components/metrics/client_info.h" |
| 126 #include "components/net_log/chrome_net_log.h" | 126 #include "components/net_log/chrome_net_log.h" |
| 127 #include "components/pref_registry/pref_registry_syncable.h" | 127 #include "components/pref_registry/pref_registry_syncable.h" |
| 128 #include "components/prefs/pref_service.h" | 128 #include "components/prefs/pref_service.h" |
| 129 #include "components/prefs/scoped_user_pref_update.h" | 129 #include "components/prefs/scoped_user_pref_update.h" |
| 130 #include "components/rappor/rappor_utils.h" | 130 #include "components/rappor/rappor_utils.h" |
| 131 #include "components/security_interstitials/core/ssl_error_ui.h" | 131 #include "components/security_interstitials/core/ssl_error_ui.h" |
| 132 #include "components/signin/core/common/profile_management_switches.h" | 132 #include "components/signin/core/common/profile_management_switches.h" |
| 133 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" | 133 #include "components/startup_metric_utils/browser/startup_metric_message_filter.
h" |
| 134 #include "components/translate/core/common/translate_switches.h" | 134 #include "components/translate/core/common/translate_switches.h" |
| 135 #include "components/url_formatter/url_fixer.h" | 135 #include "components/url_formatter/url_fixer.h" |
| 136 #include "components/variations/variations_associated_data.h" | 136 #include "components/variations/variations_associated_data.h" |
| 137 #include "components/version_info/version_info.h" | 137 #include "components/version_info/version_info.h" |
| 138 #include "content/public/browser/browser_child_process_host.h" | 138 #include "content/public/browser/browser_child_process_host.h" |
| 139 #include "content/public/browser/browser_main_parts.h" | 139 #include "content/public/browser/browser_main_parts.h" |
| 140 #include "content/public/browser/browser_ppapi_host.h" | 140 #include "content/public/browser/browser_ppapi_host.h" |
| 141 #include "content/public/browser/browser_thread.h" | 141 #include "content/public/browser/browser_thread.h" |
| 142 #include "content/public/browser/browser_url_handler.h" | 142 #include "content/public/browser/browser_url_handler.h" |
| 143 #include "content/public/browser/child_process_data.h" | 143 #include "content/public/browser/child_process_data.h" |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 profile->GetPath(), | 986 profile->GetPath(), |
| 987 context)); | 987 context)); |
| 988 #endif | 988 #endif |
| 989 #if defined(OS_ANDROID) | 989 #if defined(OS_ANDROID) |
| 990 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 990 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
| 991 #endif | 991 #endif |
| 992 DataReductionProxyChromeSettings* data_reduction_proxy_settings = | 992 DataReductionProxyChromeSettings* data_reduction_proxy_settings = |
| 993 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); | 993 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); |
| 994 host->AddFilter(new data_reduction_proxy::DataReductionProxyMessageFilter( | 994 host->AddFilter(new data_reduction_proxy::DataReductionProxyMessageFilter( |
| 995 data_reduction_proxy_settings)); | 995 data_reduction_proxy_settings)); |
| 996 host->AddFilter(new startup_metric_utils::StartupMetricMessageFilter()); |
| 996 | 997 |
| 997 host->GetImmediateSender()->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 998 host->GetImmediateSender()->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
| 998 profile->IsOffTheRecord())); | 999 profile->IsOffTheRecord())); |
| 999 | 1000 |
| 1000 for (size_t i = 0; i < extra_parts_.size(); ++i) | 1001 for (size_t i = 0; i < extra_parts_.size(); ++i) |
| 1001 extra_parts_[i]->RenderProcessWillLaunch(host); | 1002 extra_parts_[i]->RenderProcessWillLaunch(host); |
| 1002 | 1003 |
| 1003 RendererContentSettingRules rules; | 1004 RendererContentSettingRules rules; |
| 1004 if (host->IsForGuestsOnly()) { | 1005 if (host->IsForGuestsOnly()) { |
| 1005 #if defined(ENABLE_EXTENSIONS) | 1006 #if defined(ENABLE_EXTENSIONS) |
| (...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 } | 2712 } |
| 2712 | 2713 |
| 2713 return false; | 2714 return false; |
| 2714 } | 2715 } |
| 2715 | 2716 |
| 2716 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { | 2717 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { |
| 2717 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; | 2718 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; |
| 2718 } | 2719 } |
| 2719 #endif // defined(OS_WIN) | 2720 #endif // defined(OS_WIN) |
| 2720 | 2721 |
| 2721 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( | |
| 2722 content::ServiceRegistry* registry) { | |
| 2723 registry->AddService( | |
| 2724 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); | |
| 2725 } | |
| 2726 | |
| 2727 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( | 2722 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( |
| 2728 content::ServiceRegistry* registry, | 2723 content::ServiceRegistry* registry, |
| 2729 content::RenderFrameHost* render_frame_host) { | 2724 content::RenderFrameHost* render_frame_host) { |
| 2730 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2725 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
| 2731 #if defined(OS_CHROMEOS) | 2726 #if defined(OS_CHROMEOS) |
| 2732 registry->AddService( | 2727 registry->AddService( |
| 2733 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2728 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
| 2734 render_frame_host)); | 2729 render_frame_host)); |
| 2735 #endif // defined(OS_CHROMEOS) | 2730 #endif // defined(OS_CHROMEOS) |
| 2736 | 2731 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2962 if (channel <= kMaxDisableEncryptionChannel) { | 2957 if (channel <= kMaxDisableEncryptionChannel) { |
| 2963 static const char* const kWebRtcDevSwitchNames[] = { | 2958 static const char* const kWebRtcDevSwitchNames[] = { |
| 2964 switches::kDisableWebRtcEncryption, | 2959 switches::kDisableWebRtcEncryption, |
| 2965 }; | 2960 }; |
| 2966 to_command_line->CopySwitchesFrom(from_command_line, | 2961 to_command_line->CopySwitchesFrom(from_command_line, |
| 2967 kWebRtcDevSwitchNames, | 2962 kWebRtcDevSwitchNames, |
| 2968 arraysize(kWebRtcDevSwitchNames)); | 2963 arraysize(kWebRtcDevSwitchNames)); |
| 2969 } | 2964 } |
| 2970 } | 2965 } |
| 2971 #endif // defined(ENABLE_WEBRTC) | 2966 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |