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 23 matching lines...) Expand all Loading... | |
34 #include "chrome/browser/browser_process.h" | 34 #include "chrome/browser/browser_process.h" |
35 #include "chrome/browser/browser_shutdown.h" | 35 #include "chrome/browser/browser_shutdown.h" |
36 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 36 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
37 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 37 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
38 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 38 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
39 #include "chrome/browser/browsing_data/origin_filter_builder.h" | 39 #include "chrome/browser/browsing_data/origin_filter_builder.h" |
40 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" | 40 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" |
41 #include "chrome/browser/budget_service/budget_service_impl.h" | 41 #include "chrome/browser/budget_service/budget_service_impl.h" |
42 #include "chrome/browser/character_encoding.h" | 42 #include "chrome/browser/character_encoding.h" |
43 #include "chrome/browser/chrome_content_browser_client_parts.h" | 43 #include "chrome/browser/chrome_content_browser_client_parts.h" |
44 #include "chrome/browser/chrome_net_benchmarking_message_filter.h" | 44 #include "chrome/browser/net_benchmarking_impl.h" |
Sam McNally
2016/12/08 22:57:46
Resort.
dvallet
2016/12/12 22:04:37
Done
| |
45 #include "chrome/browser/chrome_quota_permission_context.h" | 45 #include "chrome/browser/chrome_quota_permission_context.h" |
46 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 46 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
47 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 47 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
48 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 48 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
49 #include "chrome/browser/defaults.h" | 49 #include "chrome/browser/defaults.h" |
50 #include "chrome/browser/download/download_prefs.h" | 50 #include "chrome/browser/download/download_prefs.h" |
51 #include "chrome/browser/engagement/site_engagement_eviction_policy.h" | 51 #include "chrome/browser/engagement/site_engagement_eviction_policy.h" |
52 #include "chrome/browser/font_family_cache.h" | 52 #include "chrome/browser/font_family_cache.h" |
53 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 53 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
54 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" | 54 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1024 content::WebContentsViewDelegate* | 1024 content::WebContentsViewDelegate* |
1025 ChromeContentBrowserClient::GetWebContentsViewDelegate( | 1025 ChromeContentBrowserClient::GetWebContentsViewDelegate( |
1026 content::WebContents* web_contents) { | 1026 content::WebContents* web_contents) { |
1027 return chrome::CreateWebContentsViewDelegate(web_contents); | 1027 return chrome::CreateWebContentsViewDelegate(web_contents); |
1028 } | 1028 } |
1029 | 1029 |
1030 void ChromeContentBrowserClient::RenderProcessWillLaunch( | 1030 void ChromeContentBrowserClient::RenderProcessWillLaunch( |
1031 content::RenderProcessHost* host) { | 1031 content::RenderProcessHost* host) { |
1032 int id = host->GetID(); | 1032 int id = host->GetID(); |
1033 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 1033 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
1034 net::URLRequestContextGetter* context = | |
1035 host->GetStoragePartition()->GetURLRequestContext(); | |
1036 | |
1037 host->AddFilter(new ChromeRenderMessageFilter( | 1034 host->AddFilter(new ChromeRenderMessageFilter( |
1038 id, profile, host->GetStoragePartition()->GetServiceWorkerContext())); | 1035 id, profile, host->GetStoragePartition()->GetServiceWorkerContext())); |
1039 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1036 #if BUILDFLAG(ENABLE_EXTENSIONS) |
1040 host->AddFilter(new cast::CastTransportHostFilter); | 1037 host->AddFilter(new cast::CastTransportHostFilter); |
1041 #endif | 1038 #endif |
1042 #if BUILDFLAG(ENABLE_PRINTING) | 1039 #if BUILDFLAG(ENABLE_PRINTING) |
1043 host->AddFilter(new printing::PrintingMessageFilter(id, profile)); | 1040 host->AddFilter(new printing::PrintingMessageFilter(id, profile)); |
1044 #endif | 1041 #endif |
1045 #if BUILDFLAG(ENABLE_SPELLCHECK) | 1042 #if BUILDFLAG(ENABLE_SPELLCHECK) |
1046 host->AddFilter(new SpellCheckMessageFilter(id)); | 1043 host->AddFilter(new SpellCheckMessageFilter(id)); |
1047 #endif | 1044 #endif |
1048 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) | 1045 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) |
1049 host->AddFilter(new SpellCheckMessageFilterPlatform(id)); | 1046 host->AddFilter(new SpellCheckMessageFilterPlatform(id)); |
1050 #endif | 1047 #endif |
1051 host->AddFilter(new ChromeNetBenchmarkingMessageFilter(profile, context)); | |
1052 host->AddFilter(new prerender::PrerenderMessageFilter(id, profile)); | 1048 host->AddFilter(new prerender::PrerenderMessageFilter(id, profile)); |
1053 host->AddFilter(new TtsMessageFilter(host->GetBrowserContext())); | 1049 host->AddFilter(new TtsMessageFilter(host->GetBrowserContext())); |
1054 #if BUILDFLAG(ENABLE_WEBRTC) | 1050 #if BUILDFLAG(ENABLE_WEBRTC) |
1055 WebRtcLoggingHandlerHost* webrtc_logging_handler_host = | 1051 WebRtcLoggingHandlerHost* webrtc_logging_handler_host = |
1056 new WebRtcLoggingHandlerHost(id, profile, | 1052 new WebRtcLoggingHandlerHost(id, profile, |
1057 g_browser_process->webrtc_log_uploader()); | 1053 g_browser_process->webrtc_log_uploader()); |
1058 host->AddFilter(webrtc_logging_handler_host); | 1054 host->AddFilter(webrtc_logging_handler_host); |
1059 host->SetUserData(WebRtcLoggingHandlerHost::kWebRtcLoggingHandlerHostKey, | 1055 host->SetUserData(WebRtcLoggingHandlerHost::kWebRtcLoggingHandlerHostKey, |
1060 new base::UserDataAdapter<WebRtcLoggingHandlerHost>( | 1056 new base::UserDataAdapter<WebRtcLoggingHandlerHost>( |
1061 webrtc_logging_handler_host)); | 1057 webrtc_logging_handler_host)); |
1062 | 1058 |
1063 AudioDebugRecordingsHandler* audio_debug_recordings_handler = | 1059 AudioDebugRecordingsHandler* audio_debug_recordings_handler = |
1064 new AudioDebugRecordingsHandler(profile); | 1060 new AudioDebugRecordingsHandler(profile); |
1065 host->SetUserData( | 1061 host->SetUserData( |
1066 AudioDebugRecordingsHandler::kAudioDebugRecordingsHandlerKey, | 1062 AudioDebugRecordingsHandler::kAudioDebugRecordingsHandlerKey, |
1067 new base::UserDataAdapter<AudioDebugRecordingsHandler>( | 1063 new base::UserDataAdapter<AudioDebugRecordingsHandler>( |
1068 audio_debug_recordings_handler)); | 1064 audio_debug_recordings_handler)); |
1069 | 1065 |
1070 #endif | 1066 #endif |
1071 #if !defined(DISABLE_NACL) | 1067 #if !defined(DISABLE_NACL) |
1068 net::URLRequestContextGetter* context = | |
1069 host->GetStoragePartition()->GetURLRequestContext(); | |
1072 host->AddFilter(new nacl::NaClHostMessageFilter( | 1070 host->AddFilter(new nacl::NaClHostMessageFilter( |
1073 id, profile->IsOffTheRecord(), | 1071 id, profile->IsOffTheRecord(), |
1074 profile->GetPath(), | 1072 profile->GetPath(), |
1075 context)); | 1073 context)); |
1076 #endif | 1074 #endif |
1077 #if defined(OS_ANDROID) | 1075 #if defined(OS_ANDROID) |
1078 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 1076 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
1079 #endif | 1077 #endif |
1080 | 1078 |
1081 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 1079 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2920 return result == sandbox::SBOX_ALL_OK; | 2918 return result == sandbox::SBOX_ALL_OK; |
2921 } | 2919 } |
2922 #endif // defined(OS_WIN) | 2920 #endif // defined(OS_WIN) |
2923 | 2921 |
2924 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( | 2922 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( |
2925 service_manager::InterfaceRegistry* registry, | 2923 service_manager::InterfaceRegistry* registry, |
2926 content::RenderProcessHost* render_process_host) { | 2924 content::RenderProcessHost* render_process_host) { |
2927 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = | 2925 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = |
2928 content::BrowserThread::GetTaskRunnerForThread( | 2926 content::BrowserThread::GetTaskRunnerForThread( |
2929 content::BrowserThread::UI); | 2927 content::BrowserThread::UI); |
2928 Profile* profile = | |
2929 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); | |
2930 net::URLRequestContextGetter* context = | |
2931 render_process_host->GetStoragePartition()->GetURLRequestContext(); | |
2932 registry->AddInterface( | |
2933 base::Bind(&NetBenchmarkingImpl::Create, profile, context)); | |
2930 registry->AddInterface( | 2934 registry->AddInterface( |
2931 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), | 2935 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), |
2932 ui_task_runner); | 2936 ui_task_runner); |
2933 registry->AddInterface( | 2937 registry->AddInterface( |
2934 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), | 2938 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), |
2935 ui_task_runner); | 2939 ui_task_runner); |
2936 registry->AddInterface( | 2940 registry->AddInterface( |
2937 base::Bind(&rappor::RapporRecorderImpl::Create, | 2941 base::Bind(&rappor::RapporRecorderImpl::Create, |
2938 g_browser_process->rappor_service()), | 2942 g_browser_process->rappor_service()), |
2939 ui_task_runner); | 2943 ui_task_runner); |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3310 render_frame_host, std::move(source), std::move(request)); | 3314 render_frame_host, std::move(source), std::move(request)); |
3311 #else | 3315 #else |
3312 // Chrome's media remoting implementation depends on the Media Router | 3316 // Chrome's media remoting implementation depends on the Media Router |
3313 // infrastructure to identify remote sinks and provide the user interface for | 3317 // infrastructure to identify remote sinks and provide the user interface for |
3314 // sink selection. In the case where the Media Router is not present, simply | 3318 // sink selection. In the case where the Media Router is not present, simply |
3315 // drop the interface request. This will prevent code paths for media remoting | 3319 // drop the interface request. This will prevent code paths for media remoting |
3316 // in the renderer process from activating. | 3320 // in the renderer process from activating. |
3317 #endif | 3321 #endif |
3318 } | 3322 } |
3319 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) | 3323 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) |
OLD | NEW |