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 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()); | |
997 | 996 |
998 host->GetImmediateSender()->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 997 host->GetImmediateSender()->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
999 profile->IsOffTheRecord())); | 998 profile->IsOffTheRecord())); |
1000 | 999 |
1001 for (size_t i = 0; i < extra_parts_.size(); ++i) | 1000 for (size_t i = 0; i < extra_parts_.size(); ++i) |
1002 extra_parts_[i]->RenderProcessWillLaunch(host); | 1001 extra_parts_[i]->RenderProcessWillLaunch(host); |
1003 | 1002 |
1004 RendererContentSettingRules rules; | 1003 RendererContentSettingRules rules; |
1005 if (host->IsForGuestsOnly()) { | 1004 if (host->IsForGuestsOnly()) { |
1006 #if defined(ENABLE_EXTENSIONS) | 1005 #if defined(ENABLE_EXTENSIONS) |
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 } | 2711 } |
2713 | 2712 |
2714 return false; | 2713 return false; |
2715 } | 2714 } |
2716 | 2715 |
2717 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { | 2716 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { |
2718 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; | 2717 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; |
2719 } | 2718 } |
2720 #endif // defined(OS_WIN) | 2719 #endif // defined(OS_WIN) |
2721 | 2720 |
| 2721 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( |
| 2722 content::ServiceRegistry* registry) { |
| 2723 registry->AddService( |
| 2724 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
| 2725 } |
| 2726 |
2722 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( | 2727 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( |
2723 content::ServiceRegistry* registry, | 2728 content::ServiceRegistry* registry, |
2724 content::RenderFrameHost* render_frame_host) { | 2729 content::RenderFrameHost* render_frame_host) { |
2725 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2730 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
2726 #if defined(OS_CHROMEOS) | 2731 #if defined(OS_CHROMEOS) |
2727 registry->AddService( | 2732 registry->AddService( |
2728 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2733 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
2729 render_frame_host)); | 2734 render_frame_host)); |
2730 #endif // defined(OS_CHROMEOS) | 2735 #endif // defined(OS_CHROMEOS) |
2731 | 2736 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2957 if (channel <= kMaxDisableEncryptionChannel) { | 2962 if (channel <= kMaxDisableEncryptionChannel) { |
2958 static const char* const kWebRtcDevSwitchNames[] = { | 2963 static const char* const kWebRtcDevSwitchNames[] = { |
2959 switches::kDisableWebRtcEncryption, | 2964 switches::kDisableWebRtcEncryption, |
2960 }; | 2965 }; |
2961 to_command_line->CopySwitchesFrom(from_command_line, | 2966 to_command_line->CopySwitchesFrom(from_command_line, |
2962 kWebRtcDevSwitchNames, | 2967 kWebRtcDevSwitchNames, |
2963 arraysize(kWebRtcDevSwitchNames)); | 2968 arraysize(kWebRtcDevSwitchNames)); |
2964 } | 2969 } |
2965 } | 2970 } |
2966 #endif // defined(ENABLE_WEBRTC) | 2971 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |