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_message_filter.
h" | 133 #include "components/startup_metric_utils/browser/startup_metric_host_impl.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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 profile->GetPath(), | 985 profile->GetPath(), |
986 context)); | 986 context)); |
987 #endif | 987 #endif |
988 #if defined(OS_ANDROID) | 988 #if defined(OS_ANDROID) |
989 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 989 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
990 #endif | 990 #endif |
991 DataReductionProxyChromeSettings* data_reduction_proxy_settings = | 991 DataReductionProxyChromeSettings* data_reduction_proxy_settings = |
992 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); | 992 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); |
993 host->AddFilter(new data_reduction_proxy::DataReductionProxyMessageFilter( | 993 host->AddFilter(new data_reduction_proxy::DataReductionProxyMessageFilter( |
994 data_reduction_proxy_settings)); | 994 data_reduction_proxy_settings)); |
995 host->AddFilter(new startup_metric_utils::StartupMetricMessageFilter()); | |
996 | 995 |
997 host->GetImmediateSender()->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 996 host->GetImmediateSender()->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
998 profile->IsOffTheRecord())); | 997 profile->IsOffTheRecord())); |
999 | 998 |
1000 for (size_t i = 0; i < extra_parts_.size(); ++i) | 999 for (size_t i = 0; i < extra_parts_.size(); ++i) |
1001 extra_parts_[i]->RenderProcessWillLaunch(host); | 1000 extra_parts_[i]->RenderProcessWillLaunch(host); |
1002 | 1001 |
1003 RendererContentSettingRules rules; | 1002 RendererContentSettingRules rules; |
1004 if (host->IsForGuestsOnly()) { | 1003 if (host->IsForGuestsOnly()) { |
1005 #if defined(ENABLE_EXTENSIONS) | 1004 #if defined(ENABLE_EXTENSIONS) |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2720 } | 2719 } |
2721 | 2720 |
2722 return false; | 2721 return false; |
2723 } | 2722 } |
2724 | 2723 |
2725 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { | 2724 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { |
2726 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; | 2725 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; |
2727 } | 2726 } |
2728 #endif // defined(OS_WIN) | 2727 #endif // defined(OS_WIN) |
2729 | 2728 |
| 2729 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( |
| 2730 content::ServiceRegistry* registry) { |
| 2731 registry->AddService( |
| 2732 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
| 2733 } |
| 2734 |
2730 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( | 2735 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( |
2731 content::ServiceRegistry* registry, | 2736 content::ServiceRegistry* registry, |
2732 content::RenderFrameHost* render_frame_host) { | 2737 content::RenderFrameHost* render_frame_host) { |
2733 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2738 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
2734 #if defined(OS_CHROMEOS) | 2739 #if defined(OS_CHROMEOS) |
2735 registry->AddService( | 2740 registry->AddService( |
2736 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2741 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
2737 render_frame_host)); | 2742 render_frame_host)); |
2738 #endif // defined(OS_CHROMEOS) | 2743 #endif // defined(OS_CHROMEOS) |
2739 | 2744 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 if (channel <= kMaxDisableEncryptionChannel) { | 2965 if (channel <= kMaxDisableEncryptionChannel) { |
2961 static const char* const kWebRtcDevSwitchNames[] = { | 2966 static const char* const kWebRtcDevSwitchNames[] = { |
2962 switches::kDisableWebRtcEncryption, | 2967 switches::kDisableWebRtcEncryption, |
2963 }; | 2968 }; |
2964 to_command_line->CopySwitchesFrom(from_command_line, | 2969 to_command_line->CopySwitchesFrom(from_command_line, |
2965 kWebRtcDevSwitchNames, | 2970 kWebRtcDevSwitchNames, |
2966 arraysize(kWebRtcDevSwitchNames)); | 2971 arraysize(kWebRtcDevSwitchNames)); |
2967 } | 2972 } |
2968 } | 2973 } |
2969 #endif // defined(ENABLE_WEBRTC) | 2974 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |