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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 #endif | 1008 #endif |
1009 #if !defined(DISABLE_NACL) | 1009 #if !defined(DISABLE_NACL) |
1010 host->AddFilter(new nacl::NaClHostMessageFilter( | 1010 host->AddFilter(new nacl::NaClHostMessageFilter( |
1011 id, profile->IsOffTheRecord(), | 1011 id, profile->IsOffTheRecord(), |
1012 profile->GetPath(), | 1012 profile->GetPath(), |
1013 context)); | 1013 context)); |
1014 #endif | 1014 #endif |
1015 #if defined(OS_ANDROID) | 1015 #if defined(OS_ANDROID) |
1016 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 1016 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
1017 #endif | 1017 #endif |
1018 DataReductionProxyChromeSettings* data_reduction_proxy_settings = | |
1019 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); | |
1020 host->AddFilter(new data_reduction_proxy::DataReductionProxyMessageFilter( | |
1021 data_reduction_proxy_settings)); | |
1022 | 1018 |
1023 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 1019 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
1024 profile->IsOffTheRecord())); | 1020 profile->IsOffTheRecord())); |
1025 | 1021 |
1026 for (size_t i = 0; i < extra_parts_.size(); ++i) | 1022 for (size_t i = 0; i < extra_parts_.size(); ++i) |
1027 extra_parts_[i]->RenderProcessWillLaunch(host); | 1023 extra_parts_[i]->RenderProcessWillLaunch(host); |
1028 | 1024 |
1029 RendererContentSettingRules rules; | 1025 RendererContentSettingRules rules; |
1030 if (host->IsForGuestsOnly()) { | 1026 if (host->IsForGuestsOnly()) { |
1031 #if defined(ENABLE_EXTENSIONS) | 1027 #if defined(ENABLE_EXTENSIONS) |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2777 | 2773 |
2778 return false; | 2774 return false; |
2779 } | 2775 } |
2780 #endif // defined(OS_WIN) | 2776 #endif // defined(OS_WIN) |
2781 | 2777 |
2782 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( | 2778 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( |
2783 shell::InterfaceRegistry* registry, | 2779 shell::InterfaceRegistry* registry, |
2784 content::RenderProcessHost* render_process_host) { | 2780 content::RenderProcessHost* render_process_host) { |
2785 registry->AddInterface( | 2781 registry->AddInterface( |
2786 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); | 2782 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
| 2783 |
| 2784 DataReductionProxyChromeSettings* data_reduction_proxy_settings = |
| 2785 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( |
| 2786 render_process_host->GetBrowserContext()); |
| 2787 auto* data_reduction_proxy_host = |
| 2788 new data_reduction_proxy::DataReductionProxyHostImpl( |
| 2789 data_reduction_proxy_settings, render_process_host); |
| 2790 // The data_reduction_proxy_host is a render process host observer, so here we |
| 2791 // can use base::Unretained safely. |
| 2792 registry->AddInterface( |
| 2793 base::Bind(&data_reduction_proxy::DataReductionProxyHostImpl::BindRequest, |
| 2794 base::Unretained(data_reduction_proxy_host)), |
| 2795 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
2787 } | 2796 } |
2788 | 2797 |
2789 void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces( | 2798 void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces( |
2790 shell::InterfaceRegistry* registry, | 2799 shell::InterfaceRegistry* registry, |
2791 content::RenderFrameHost* render_frame_host) { | 2800 content::RenderFrameHost* render_frame_host) { |
2792 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2801 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
2793 #if defined(OS_CHROMEOS) | 2802 #if defined(OS_CHROMEOS) |
2794 registry->AddInterface( | 2803 registry->AddInterface( |
2795 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2804 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
2796 render_frame_host)); | 2805 render_frame_host)); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3044 if (channel <= kMaxDisableEncryptionChannel) { | 3053 if (channel <= kMaxDisableEncryptionChannel) { |
3045 static const char* const kWebRtcDevSwitchNames[] = { | 3054 static const char* const kWebRtcDevSwitchNames[] = { |
3046 switches::kDisableWebRtcEncryption, | 3055 switches::kDisableWebRtcEncryption, |
3047 }; | 3056 }; |
3048 to_command_line->CopySwitchesFrom(from_command_line, | 3057 to_command_line->CopySwitchesFrom(from_command_line, |
3049 kWebRtcDevSwitchNames, | 3058 kWebRtcDevSwitchNames, |
3050 arraysize(kWebRtcDevSwitchNames)); | 3059 arraysize(kWebRtcDevSwitchNames)); |
3051 } | 3060 } |
3052 } | 3061 } |
3053 #endif // defined(ENABLE_WEBRTC) | 3062 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |