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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 net::URLRequestContextGetter* context = | 941 net::URLRequestContextGetter* context = |
942 host->GetStoragePartition()->GetURLRequestContext(); | 942 host->GetStoragePartition()->GetURLRequestContext(); |
943 | 943 |
944 host->AddFilter(new ChromeRenderMessageFilter(id, profile)); | 944 host->AddFilter(new ChromeRenderMessageFilter(id, profile)); |
945 #if defined(ENABLE_EXTENSIONS) | 945 #if defined(ENABLE_EXTENSIONS) |
946 host->AddFilter(new cast::CastTransportHostFilter); | 946 host->AddFilter(new cast::CastTransportHostFilter); |
947 #endif | 947 #endif |
948 #if defined(ENABLE_PRINTING) | 948 #if defined(ENABLE_PRINTING) |
949 host->AddFilter(new printing::PrintingMessageFilter(id, profile)); | 949 host->AddFilter(new printing::PrintingMessageFilter(id, profile)); |
950 #endif | 950 #endif |
951 host->AddFilter(new SearchProviderInstallStateMessageFilter(id, profile)); | 951 auto* search_provider = new SearchProviderInstallStateMessageFilterAdapter( |
| 952 new SearchProviderInstallStateMessageFilter(id, profile)); |
| 953 host->GetServiceRegistry()->AddService<mojom::SearchProviderInstallState>( |
| 954 base::Bind(&SearchProviderInstallStateMessageFilter::Bind, |
| 955 base::Unretained(search_provider->Get())), |
| 956 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 957 host->SetUserData( |
| 958 SearchProviderInstallStateMessageFilter::kRenderProcessHostKey, |
| 959 search_provider); |
952 #if defined(ENABLE_SPELLCHECK) | 960 #if defined(ENABLE_SPELLCHECK) |
953 host->AddFilter(new SpellCheckMessageFilter(id)); | 961 host->AddFilter(new SpellCheckMessageFilter(id)); |
954 #endif | 962 #endif |
955 #if defined(USE_BROWSER_SPELLCHECKER) | 963 #if defined(USE_BROWSER_SPELLCHECKER) |
956 host->AddFilter(new SpellCheckMessageFilterPlatform(id)); | 964 host->AddFilter(new SpellCheckMessageFilterPlatform(id)); |
957 #endif | 965 #endif |
958 host->AddFilter(new ChromeNetBenchmarkingMessageFilter(profile, context)); | 966 host->AddFilter(new ChromeNetBenchmarkingMessageFilter(profile, context)); |
959 host->AddFilter(new prerender::PrerenderMessageFilter(id, profile)); | 967 host->AddFilter(new prerender::PrerenderMessageFilter(id, profile)); |
960 host->AddFilter(new TtsMessageFilter(host->GetBrowserContext())); | 968 host->AddFilter(new TtsMessageFilter(host->GetBrowserContext())); |
961 #if defined(ENABLE_WEBRTC) | 969 #if defined(ENABLE_WEBRTC) |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2714 | 2722 |
2715 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { | 2723 bool ChromeContentBrowserClient::ShouldUseWindowsPrefetchArgument() const { |
2716 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; | 2724 return startup_metric_utils::GetPreReadOptions().use_prefetch_argument; |
2717 } | 2725 } |
2718 #endif // defined(OS_WIN) | 2726 #endif // defined(OS_WIN) |
2719 | 2727 |
2720 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( | 2728 void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( |
2721 content::ServiceRegistry* registry) { | 2729 content::ServiceRegistry* registry) { |
2722 registry->AddService( | 2730 registry->AddService( |
2723 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); | 2731 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
| 2732 registry->AddService( |
| 2733 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
2724 } | 2734 } |
2725 | 2735 |
2726 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( | 2736 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( |
2727 content::ServiceRegistry* registry, | 2737 content::ServiceRegistry* registry, |
2728 content::RenderFrameHost* render_frame_host) { | 2738 content::RenderFrameHost* render_frame_host) { |
2729 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 2739 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
2730 #if defined(OS_CHROMEOS) | 2740 #if defined(OS_CHROMEOS) |
2731 registry->AddService( | 2741 registry->AddService( |
2732 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 2742 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
2733 render_frame_host)); | 2743 render_frame_host)); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2958 if (channel <= kMaxDisableEncryptionChannel) { | 2968 if (channel <= kMaxDisableEncryptionChannel) { |
2959 static const char* const kWebRtcDevSwitchNames[] = { | 2969 static const char* const kWebRtcDevSwitchNames[] = { |
2960 switches::kDisableWebRtcEncryption, | 2970 switches::kDisableWebRtcEncryption, |
2961 }; | 2971 }; |
2962 to_command_line->CopySwitchesFrom(from_command_line, | 2972 to_command_line->CopySwitchesFrom(from_command_line, |
2963 kWebRtcDevSwitchNames, | 2973 kWebRtcDevSwitchNames, |
2964 arraysize(kWebRtcDevSwitchNames)); | 2974 arraysize(kWebRtcDevSwitchNames)); |
2965 } | 2975 } |
2966 } | 2976 } |
2967 #endif // defined(ENABLE_WEBRTC) | 2977 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |