| 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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 #endif | 996 #endif |
| 997 #if !defined(DISABLE_NACL) | 997 #if !defined(DISABLE_NACL) |
| 998 host->AddFilter(new nacl::NaClHostMessageFilter( | 998 host->AddFilter(new nacl::NaClHostMessageFilter( |
| 999 id, profile->IsOffTheRecord(), | 999 id, profile->IsOffTheRecord(), |
| 1000 profile->GetPath(), | 1000 profile->GetPath(), |
| 1001 context)); | 1001 context)); |
| 1002 #endif | 1002 #endif |
| 1003 #if defined(OS_ANDROID) | 1003 #if defined(OS_ANDROID) |
| 1004 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 1004 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
| 1005 #endif | 1005 #endif |
| 1006 DataReductionProxyChromeSettings* data_reduction_proxy_settings = | |
| 1007 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); | |
| 1008 host->AddFilter(new data_reduction_proxy::DataReductionProxyMessageFilter( | |
| 1009 data_reduction_proxy_settings)); | |
| 1010 | 1006 |
| 1011 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 1007 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
| 1012 profile->IsOffTheRecord())); | 1008 profile->IsOffTheRecord())); |
| 1013 | 1009 |
| 1014 for (size_t i = 0; i < extra_parts_.size(); ++i) | 1010 for (size_t i = 0; i < extra_parts_.size(); ++i) |
| 1015 extra_parts_[i]->RenderProcessWillLaunch(host); | 1011 extra_parts_[i]->RenderProcessWillLaunch(host); |
| 1016 | 1012 |
| 1017 RendererContentSettingRules rules; | 1013 RendererContentSettingRules rules; |
| 1018 if (host->IsForGuestsOnly()) { | 1014 if (host->IsForGuestsOnly()) { |
| 1019 #if defined(ENABLE_EXTENSIONS) | 1015 #if defined(ENABLE_EXTENSIONS) |
| (...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2740 | 2736 |
| 2741 return false; | 2737 return false; |
| 2742 } | 2738 } |
| 2743 #endif // defined(OS_WIN) | 2739 #endif // defined(OS_WIN) |
| 2744 | 2740 |
| 2745 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( | 2741 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( |
| 2746 shell::InterfaceRegistry* registry, | 2742 shell::InterfaceRegistry* registry, |
| 2747 content::RenderProcessHost* render_process_host) { | 2743 content::RenderProcessHost* render_process_host) { |
| 2748 registry->AddInterface( | 2744 registry->AddInterface( |
| 2749 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); | 2745 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
| 2746 |
| 2747 Profile* profile = |
| 2748 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); |
| 2749 DataReductionProxyChromeSettings* data_reduction_proxy_settings = |
| 2750 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); |
| 2751 auto* data_reduction_proxy_host = |
| 2752 new data_reduction_proxy::DataReductionProxyHostImpl( |
| 2753 data_reduction_proxy_settings |
| 2754 ? data_reduction_proxy_settings->Config() |
| 2755 : nullptr, |
| 2756 render_process_host); |
| 2757 // The data_reduction_proxy_host is a render process host observer, so here we |
| 2758 // can use base::Unretained safely. |
| 2759 registry->AddInterface( |
| 2760 base::Bind(&data_reduction_proxy::DataReductionProxyHostImpl::BindRequest, |
| 2761 base::Unretained(data_reduction_proxy_host)), |
| 2762 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 2750 } | 2763 } |
| 2751 | 2764 |
| 2752 void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces( | 2765 void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces( |
| 2753 shell::InterfaceRegistry* registry, | 2766 shell::InterfaceRegistry* registry, |
| 2754 content::RenderFrameHost* render_frame_host) { | 2767 content::RenderFrameHost* render_frame_host) { |
| 2755 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2768 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
| 2756 #if defined(OS_CHROMEOS) | 2769 #if defined(OS_CHROMEOS) |
| 2757 registry->AddInterface( | 2770 registry->AddInterface( |
| 2758 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2771 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
| 2759 render_frame_host)); | 2772 render_frame_host)); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 if (channel <= kMaxDisableEncryptionChannel) { | 2997 if (channel <= kMaxDisableEncryptionChannel) { |
| 2985 static const char* const kWebRtcDevSwitchNames[] = { | 2998 static const char* const kWebRtcDevSwitchNames[] = { |
| 2986 switches::kDisableWebRtcEncryption, | 2999 switches::kDisableWebRtcEncryption, |
| 2987 }; | 3000 }; |
| 2988 to_command_line->CopySwitchesFrom(from_command_line, | 3001 to_command_line->CopySwitchesFrom(from_command_line, |
| 2989 kWebRtcDevSwitchNames, | 3002 kWebRtcDevSwitchNames, |
| 2990 arraysize(kWebRtcDevSwitchNames)); | 3003 arraysize(kWebRtcDevSwitchNames)); |
| 2991 } | 3004 } |
| 2992 } | 3005 } |
| 2993 #endif // defined(ENABLE_WEBRTC) | 3006 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |