Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2063683002: Migrate components/data_reduction_proxy to Mojo interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and move AddService call into RegisterRenderProcessMojoServices() Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #include "chromeos/chromeos_constants.h" 110 #include "chromeos/chromeos_constants.h"
111 #include "components/autofill/content/browser/content_autofill_driver_factory.h" 111 #include "components/autofill/content/browser/content_autofill_driver_factory.h"
112 #include "components/autofill/core/common/autofill_switches.h" 112 #include "components/autofill/core/common/autofill_switches.h"
113 #include "components/cdm/browser/cdm_message_filter_android.h" 113 #include "components/cdm/browser/cdm_message_filter_android.h"
114 #include "components/cloud_devices/common/cloud_devices_switches.h" 114 #include "components/cloud_devices/common/cloud_devices_switches.h"
115 #include "components/content_settings/core/browser/content_settings_utils.h" 115 #include "components/content_settings/core/browser/content_settings_utils.h"
116 #include "components/content_settings/core/browser/cookie_settings.h" 116 #include "components/content_settings/core/browser/cookie_settings.h"
117 #include "components/content_settings/core/browser/host_content_settings_map.h" 117 #include "components/content_settings/core/browser/host_content_settings_map.h"
118 #include "components/content_settings/core/common/content_settings.h" 118 #include "components/content_settings/core/common/content_settings.h"
119 #include "components/content_settings/core/common/content_settings_types.h" 119 #include "components/content_settings/core/common/content_settings_types.h"
120 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m essage_filter.h" 120 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_h ost_impl.h"
121 #include "components/dom_distiller/core/dom_distiller_switches.h" 121 #include "components/dom_distiller/core/dom_distiller_switches.h"
122 #include "components/dom_distiller/core/url_constants.h" 122 #include "components/dom_distiller/core/url_constants.h"
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"
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->GetImmediateSender()->Send(new ChromeViewMsg_SetIsIncognitoProcess( 993 host->GetImmediateSender()->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 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after
2715 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { 2711 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const {
2716 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; 2712 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument;
2717 } 2713 }
2718 #endif // defined(OS_WIN) 2714 #endif // defined(OS_WIN)
2719 2715
2720 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( 2716 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices(
2721 content::ServiceRegistry* registry, 2717 content::ServiceRegistry* registry,
2722 content::RenderProcessHost* render_process_host) { 2718 content::RenderProcessHost* render_process_host) {
2723 registry->AddService( 2719 registry->AddService(
2724 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); 2720 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create));
2721
2722 Profile* profile =
2723 Profile::FromBrowserContext(render_process_host->GetBrowserContext());
2724 DataReductionProxyChromeSettings* data_reduction_proxy_settings =
2725 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile);
2726 registry->AddService(
2727 base::Bind(&data_reduction_proxy::DataReductionProxyHostImpl::Create,
2728 data_reduction_proxy_settings),
2729 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
2725 } 2730 }
2726 2731
2727 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( 2732 void ChromeContentBrowserClient::RegisterFrameMojoShellServices(
2728 content::ServiceRegistry* registry, 2733 content::ServiceRegistry* registry,
2729 content::RenderFrameHost* render_frame_host) { 2734 content::RenderFrameHost* render_frame_host) {
2730 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. 2735 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA.
2731 #if defined(OS_CHROMEOS) 2736 #if defined(OS_CHROMEOS)
2732 registry->AddService( 2737 registry->AddService(
2733 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, 2738 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create,
2734 render_frame_host)); 2739 render_frame_host));
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2959 if (channel <= kMaxDisableEncryptionChannel) { 2964 if (channel <= kMaxDisableEncryptionChannel) {
2960 static const char* const kWebRtcDevSwitchNames[] = { 2965 static const char* const kWebRtcDevSwitchNames[] = {
2961 switches::kDisableWebRtcEncryption, 2966 switches::kDisableWebRtcEncryption,
2962 }; 2967 };
2963 to_command_line->CopySwitchesFrom(from_command_line, 2968 to_command_line->CopySwitchesFrom(from_command_line,
2964 kWebRtcDevSwitchNames, 2969 kWebRtcDevSwitchNames,
2965 arraysize(kWebRtcDevSwitchNames)); 2970 arraysize(kWebRtcDevSwitchNames));
2966 } 2971 }
2967 } 2972 }
2968 #endif // defined(ENABLE_WEBRTC) 2973 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698