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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 #if defined(ENABLE_WEBRTC) | 326 #if defined(ENABLE_WEBRTC) |
327 #include "chrome/browser/media/audio_debug_recordings_handler.h" | 327 #include "chrome/browser/media/audio_debug_recordings_handler.h" |
328 #include "chrome/browser/media/webrtc/webrtc_event_log_handler.h" | 328 #include "chrome/browser/media/webrtc/webrtc_event_log_handler.h" |
329 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" | 329 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" |
330 #endif | 330 #endif |
331 | 331 |
332 #if defined(ENABLE_MEDIA_ROUTER) | 332 #if defined(ENABLE_MEDIA_ROUTER) |
333 #include "chrome/browser/media/cast_remoting_connector.h" | 333 #include "chrome/browser/media/cast_remoting_connector.h" |
334 #include "chrome/browser/media/router/media_router_feature.h" | 334 #include "chrome/browser/media/router/media_router_feature.h" |
335 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 335 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
| 336 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp
l.h" |
336 #endif | 337 #endif |
337 | 338 |
338 #if defined(ENABLE_WAYLAND_SERVER) | 339 #if defined(ENABLE_WAYLAND_SERVER) |
339 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" | 340 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" |
340 #endif | 341 #endif |
341 | 342 |
342 #if defined(ENABLE_MOJO_MEDIA) | 343 #if defined(ENABLE_MOJO_MEDIA) |
343 #include "chrome/browser/media/output_protection_impl.h" | 344 #include "chrome/browser/media/output_protection_impl.h" |
344 #endif | 345 #endif |
345 | 346 |
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3051 params.url, | 3052 params.url, |
3052 params.transition); | 3053 params.transition); |
3053 FillNavigateParamsFromOpenURLParams(&nav_params, params); | 3054 FillNavigateParamsFromOpenURLParams(&nav_params, params); |
3054 nav_params.user_gesture = params.user_gesture; | 3055 nav_params.user_gesture = params.user_gesture; |
3055 | 3056 |
3056 Navigate(&nav_params); | 3057 Navigate(&nav_params); |
3057 callback.Run(nav_params.target_contents); | 3058 callback.Run(nav_params.target_contents); |
3058 #endif | 3059 #endif |
3059 } | 3060 } |
3060 | 3061 |
3061 content::PresentationServiceDelegate* | 3062 content::ControllerPresentationServiceDelegate* |
3062 ChromeContentBrowserClient::GetPresentationServiceDelegate( | 3063 ChromeContentBrowserClient::GetControllerPresentationServiceDelegate( |
3063 content::WebContents* web_contents) { | 3064 content::WebContents* web_contents) { |
3064 #if defined(ENABLE_MEDIA_ROUTER) | 3065 #if defined(ENABLE_MEDIA_ROUTER) |
3065 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { | 3066 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
3066 return media_router::PresentationServiceDelegateImpl:: | 3067 return media_router::PresentationServiceDelegateImpl:: |
3067 GetOrCreateForWebContents(web_contents); | 3068 GetOrCreateForWebContents(web_contents); |
3068 } | 3069 } |
3069 #endif // defined(ENABLE_MEDIA_ROUTER) | 3070 #endif // defined(ENABLE_MEDIA_ROUTER) |
3070 return nullptr; | 3071 return nullptr; |
3071 } | 3072 } |
3072 | 3073 |
| 3074 content::ReceiverPresentationServiceDelegate* |
| 3075 ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate( |
| 3076 content::WebContents* web_contents) { |
| 3077 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
| 3078 // ReceiverPresentationServiceDelegateImpl exists only for WebContents |
| 3079 // created for offscreen presentations. The WebContents must belong to |
| 3080 // an incognito profile. |
| 3081 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl:: |
| 3082 FromWebContents(web_contents)) { |
| 3083 DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord()); |
| 3084 return impl; |
| 3085 } |
| 3086 } |
| 3087 return nullptr; |
| 3088 } |
| 3089 |
3073 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, | 3090 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, |
3074 const GURL& url) { | 3091 const GURL& url) { |
3075 if (url.is_valid()) { | 3092 if (url.is_valid()) { |
3076 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 3093 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
3077 metric, url); | 3094 metric, url); |
3078 } | 3095 } |
3079 } | 3096 } |
3080 | 3097 |
3081 ScopedVector<content::NavigationThrottle> | 3098 ScopedVector<content::NavigationThrottle> |
3082 ChromeContentBrowserClient::CreateThrottlesForNavigation( | 3099 ChromeContentBrowserClient::CreateThrottlesForNavigation( |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3249 kWebRtcDevSwitchNames, | 3266 kWebRtcDevSwitchNames, |
3250 arraysize(kWebRtcDevSwitchNames)); | 3267 arraysize(kWebRtcDevSwitchNames)); |
3251 } | 3268 } |
3252 } | 3269 } |
3253 #endif // defined(ENABLE_WEBRTC) | 3270 #endif // defined(ENABLE_WEBRTC) |
3254 | 3271 |
3255 std::unique_ptr<content::MemoryCoordinatorDelegate> | 3272 std::unique_ptr<content::MemoryCoordinatorDelegate> |
3256 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { | 3273 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { |
3257 return memory::ChromeMemoryCoordinatorDelegate::Create(); | 3274 return memory::ChromeMemoryCoordinatorDelegate::Create(); |
3258 } | 3275 } |
OLD | NEW |