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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 #include "chromeos/chromeos_constants.h" | 111 #include "chromeos/chromeos_constants.h" |
112 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 112 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
113 #include "components/autofill/core/common/autofill_switches.h" | 113 #include "components/autofill/core/common/autofill_switches.h" |
114 #include "components/cdm/browser/cdm_message_filter_android.h" | 114 #include "components/cdm/browser/cdm_message_filter_android.h" |
115 #include "components/cloud_devices/common/cloud_devices_switches.h" | 115 #include "components/cloud_devices/common/cloud_devices_switches.h" |
116 #include "components/content_settings/core/browser/content_settings_utils.h" | 116 #include "components/content_settings/core/browser/content_settings_utils.h" |
117 #include "components/content_settings/core/browser/cookie_settings.h" | 117 #include "components/content_settings/core/browser/cookie_settings.h" |
118 #include "components/content_settings/core/browser/host_content_settings_map.h" | 118 #include "components/content_settings/core/browser/host_content_settings_map.h" |
119 #include "components/content_settings/core/common/content_settings.h" | 119 #include "components/content_settings/core/common/content_settings.h" |
120 #include "components/content_settings/core/common/content_settings_types.h" | 120 #include "components/content_settings/core/common/content_settings_types.h" |
121 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m essage_filter.h" | 121 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_h ost_impl.h" |
122 #include "components/dom_distiller/core/dom_distiller_switches.h" | 122 #include "components/dom_distiller/core/dom_distiller_switches.h" |
123 #include "components/dom_distiller/core/url_constants.h" | 123 #include "components/dom_distiller/core/url_constants.h" |
124 #include "components/error_page/common/error_page_switches.h" | 124 #include "components/error_page/common/error_page_switches.h" |
125 #include "components/google/core/browser/google_util.h" | 125 #include "components/google/core/browser/google_util.h" |
126 #include "components/metrics/client_info.h" | 126 #include "components/metrics/client_info.h" |
127 #include "components/net_log/chrome_net_log.h" | 127 #include "components/net_log/chrome_net_log.h" |
128 #include "components/pref_registry/pref_registry_syncable.h" | 128 #include "components/pref_registry/pref_registry_syncable.h" |
129 #include "components/prefs/pref_service.h" | 129 #include "components/prefs/pref_service.h" |
130 #include "components/prefs/scoped_user_pref_update.h" | 130 #include "components/prefs/scoped_user_pref_update.h" |
131 #include "components/rappor/rappor_utils.h" | 131 #include "components/rappor/rappor_utils.h" |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
982 #endif | 982 #endif |
983 #if !defined(DISABLE_NACL) | 983 #if !defined(DISABLE_NACL) |
984 host->AddFilter(new nacl::NaClHostMessageFilter( | 984 host->AddFilter(new nacl::NaClHostMessageFilter( |
985 id, profile->IsOffTheRecord(), | 985 id, profile->IsOffTheRecord(), |
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 = | |
993 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); | |
994 host->AddFilter(new data_reduction_proxy::DataReductionProxyMessageFilter( | |
995 data_reduction_proxy_settings)); | |
996 | 992 |
997 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 993 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
998 profile->IsOffTheRecord())); | 994 profile->IsOffTheRecord())); |
999 | 995 |
1000 for (size_t i = 0; i < extra_parts_.size(); ++i) | 996 for (size_t i = 0; i < extra_parts_.size(); ++i) |
1001 extra_parts_[i]->RenderProcessWillLaunch(host); | 997 extra_parts_[i]->RenderProcessWillLaunch(host); |
1002 | 998 |
1003 RendererContentSettingRules rules; | 999 RendererContentSettingRules rules; |
1004 if (host->IsForGuestsOnly()) { | 1000 if (host->IsForGuestsOnly()) { |
1005 #if defined(ENABLE_EXTENSIONS) | 1001 #if defined(ENABLE_EXTENSIONS) |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2713 | 2709 |
2714 return false; | 2710 return false; |
2715 } | 2711 } |
2716 #endif // defined(OS_WIN) | 2712 #endif // defined(OS_WIN) |
2717 | 2713 |
2718 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( | 2714 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( |
2719 content::ServiceRegistry* registry, | 2715 content::ServiceRegistry* registry, |
2720 content::RenderProcessHost* render_process_host) { | 2716 content::RenderProcessHost* render_process_host) { |
2721 registry->AddService( | 2717 registry->AddService( |
2722 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); | 2718 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
2719 | |
2720 Profile* profile = | |
2721 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); | |
2722 DataReductionProxyChromeSettings* data_reduction_proxy_settings = | |
2723 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); | |
Anand Mistry (off Chromium)
2016/06/24 07:12:28
I'm personally of the opinion that as much as poss
Sam McNally
2016/06/24 07:24:48
While it would be nicer to create them lazily, it'
| |
2724 auto* data_reduction_proxy_host = | |
2725 new data_reduction_proxy::DataReductionProxyHostImpl( | |
2726 data_reduction_proxy_settings | |
2727 ? data_reduction_proxy_settings->Config() | |
2728 : nullptr, | |
2729 render_process_host); | |
2730 // The data_reduction_proxy_host is a render process host observer, so here we | |
Anand Mistry (off Chromium)
2016/06/24 07:12:28
I'm convinced this is technically correct. However
Sam McNally
2016/06/24 07:24:48
This feels like a lot of unnecessary thread bounci
leonhsl(Using Gerrit)
2016/06/24 09:59:21
En,, if let DataReductionProxyHostImpl live on UI
leonhsl(Using Gerrit)
2016/06/24 14:46:11
Sorry for my misunderstanding, you could just igno
| |
2731 // can use base::Unretained safely. | |
2732 registry->AddService( | |
2733 base::Bind(&data_reduction_proxy::DataReductionProxyHostImpl::BindRequest, | |
2734 base::Unretained(data_reduction_proxy_host)), | |
2735 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | |
2723 } | 2736 } |
2724 | 2737 |
2725 void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces( | 2738 void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces( |
2726 shell::InterfaceRegistry* registry, | 2739 shell::InterfaceRegistry* registry, |
2727 content::RenderFrameHost* render_frame_host) { | 2740 content::RenderFrameHost* render_frame_host) { |
2728 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2741 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
2729 #if defined(OS_CHROMEOS) | 2742 #if defined(OS_CHROMEOS) |
2730 registry->AddInterface( | 2743 registry->AddInterface( |
2731 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2744 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
2732 render_frame_host)); | 2745 render_frame_host)); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2957 if (channel <= kMaxDisableEncryptionChannel) { | 2970 if (channel <= kMaxDisableEncryptionChannel) { |
2958 static const char* const kWebRtcDevSwitchNames[] = { | 2971 static const char* const kWebRtcDevSwitchNames[] = { |
2959 switches::kDisableWebRtcEncryption, | 2972 switches::kDisableWebRtcEncryption, |
2960 }; | 2973 }; |
2961 to_command_line->CopySwitchesFrom(from_command_line, | 2974 to_command_line->CopySwitchesFrom(from_command_line, |
2962 kWebRtcDevSwitchNames, | 2975 kWebRtcDevSwitchNames, |
2963 arraysize(kWebRtcDevSwitchNames)); | 2976 arraysize(kWebRtcDevSwitchNames)); |
2964 } | 2977 } |
2965 } | 2978 } |
2966 #endif // defined(ENABLE_WEBRTC) | 2979 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |