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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 #if defined(ENABLE_WEBRTC) | 324 #if defined(ENABLE_WEBRTC) |
325 #include "chrome/browser/media/audio_debug_recordings_handler.h" | 325 #include "chrome/browser/media/audio_debug_recordings_handler.h" |
326 #include "chrome/browser/media/webrtc/webrtc_event_log_handler.h" | 326 #include "chrome/browser/media/webrtc/webrtc_event_log_handler.h" |
327 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" | 327 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" |
328 #endif | 328 #endif |
329 | 329 |
330 #if defined(ENABLE_MEDIA_ROUTER) | 330 #if defined(ENABLE_MEDIA_ROUTER) |
331 #include "chrome/browser/media/cast_remoting_connector.h" | 331 #include "chrome/browser/media/cast_remoting_connector.h" |
332 #include "chrome/browser/media/router/media_router_feature.h" | 332 #include "chrome/browser/media/router/media_router_feature.h" |
333 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 333 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
| 334 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp
l.h" |
334 #endif | 335 #endif |
335 | 336 |
336 #if defined(ENABLE_WAYLAND_SERVER) | 337 #if defined(ENABLE_WAYLAND_SERVER) |
337 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" | 338 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" |
338 #endif | 339 #endif |
339 | 340 |
340 #if defined(ENABLE_MOJO_MEDIA) | 341 #if defined(ENABLE_MOJO_MEDIA) |
341 #include "chrome/browser/media/output_protection_impl.h" | 342 #include "chrome/browser/media/output_protection_impl.h" |
342 #endif | 343 #endif |
343 | 344 |
(...skipping 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3075 Navigate(&nav_params); | 3076 Navigate(&nav_params); |
3076 callback.Run(nav_params.target_contents); | 3077 callback.Run(nav_params.target_contents); |
3077 #endif | 3078 #endif |
3078 } | 3079 } |
3079 | 3080 |
3080 content::PresentationServiceDelegate* | 3081 content::PresentationServiceDelegate* |
3081 ChromeContentBrowserClient::GetPresentationServiceDelegate( | 3082 ChromeContentBrowserClient::GetPresentationServiceDelegate( |
3082 content::WebContents* web_contents) { | 3083 content::WebContents* web_contents) { |
3083 #if defined(ENABLE_MEDIA_ROUTER) | 3084 #if defined(ENABLE_MEDIA_ROUTER) |
3084 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { | 3085 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
| 3086 // ReceiverPresentationServiceDelegateImpl exists only for WebContents |
| 3087 // created for offscreen presentations. The WebContents must belong to |
| 3088 // an incognito profile. WebContents cannot be a presentation receiver and |
| 3089 // a presentation controller. |
| 3090 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl:: |
| 3091 FromWebContents(web_contents)) { |
| 3092 DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord()); |
| 3093 return impl; |
| 3094 } |
3085 return media_router::PresentationServiceDelegateImpl:: | 3095 return media_router::PresentationServiceDelegateImpl:: |
3086 GetOrCreateForWebContents(web_contents); | 3096 GetOrCreateForWebContents(web_contents); |
3087 } | 3097 } |
3088 #endif // defined(ENABLE_MEDIA_ROUTER) | 3098 #endif // defined(ENABLE_MEDIA_ROUTER) |
3089 return nullptr; | 3099 return nullptr; |
3090 } | 3100 } |
3091 | 3101 |
3092 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, | 3102 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, |
3093 const GURL& url) { | 3103 const GURL& url) { |
3094 if (url.is_valid()) { | 3104 if (url.is_valid()) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3264 if (channel <= kMaxDisableEncryptionChannel) { | 3274 if (channel <= kMaxDisableEncryptionChannel) { |
3265 static const char* const kWebRtcDevSwitchNames[] = { | 3275 static const char* const kWebRtcDevSwitchNames[] = { |
3266 switches::kDisableWebRtcEncryption, | 3276 switches::kDisableWebRtcEncryption, |
3267 }; | 3277 }; |
3268 to_command_line->CopySwitchesFrom(from_command_line, | 3278 to_command_line->CopySwitchesFrom(from_command_line, |
3269 kWebRtcDevSwitchNames, | 3279 kWebRtcDevSwitchNames, |
3270 arraysize(kWebRtcDevSwitchNames)); | 3280 arraysize(kWebRtcDevSwitchNames)); |
3271 } | 3281 } |
3272 } | 3282 } |
3273 #endif // defined(ENABLE_WEBRTC) | 3283 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |