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 | 324 |
325 #if defined(ENABLE_WEBRTC) | 325 #if defined(ENABLE_WEBRTC) |
326 #include "chrome/browser/media/audio_debug_recordings_handler.h" | 326 #include "chrome/browser/media/audio_debug_recordings_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 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3043 params.url, | 3044 params.url, |
3044 params.transition); | 3045 params.transition); |
3045 FillNavigateParamsFromOpenURLParams(&nav_params, params); | 3046 FillNavigateParamsFromOpenURLParams(&nav_params, params); |
3046 nav_params.user_gesture = params.user_gesture; | 3047 nav_params.user_gesture = params.user_gesture; |
3047 | 3048 |
3048 Navigate(&nav_params); | 3049 Navigate(&nav_params); |
3049 callback.Run(nav_params.target_contents); | 3050 callback.Run(nav_params.target_contents); |
3050 #endif | 3051 #endif |
3051 } | 3052 } |
3052 | 3053 |
3053 content::PresentationServiceDelegate* | 3054 content::ControllerPresentationServiceDelegate* |
3054 ChromeContentBrowserClient::GetPresentationServiceDelegate( | 3055 ChromeContentBrowserClient::GetControllerPresentationServiceDelegate( |
3055 content::WebContents* web_contents) { | 3056 content::WebContents* web_contents) { |
3056 #if defined(ENABLE_MEDIA_ROUTER) | 3057 #if defined(ENABLE_MEDIA_ROUTER) |
3057 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { | 3058 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
3058 return media_router::PresentationServiceDelegateImpl:: | 3059 return media_router::PresentationServiceDelegateImpl:: |
3059 GetOrCreateForWebContents(web_contents); | 3060 GetOrCreateForWebContents(web_contents); |
3060 } | 3061 } |
3061 #endif // defined(ENABLE_MEDIA_ROUTER) | 3062 #endif // defined(ENABLE_MEDIA_ROUTER) |
3062 return nullptr; | 3063 return nullptr; |
3063 } | 3064 } |
3064 | 3065 |
| 3066 content::ReceiverPresentationServiceDelegate* |
| 3067 ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate( |
| 3068 content::WebContents* web_contents) { |
| 3069 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
| 3070 // ReceiverPresentationServiceDelegateImpl exists only for WebContents |
| 3071 // created for offscreen presentations. The WebContents must belong to |
| 3072 // an incognito profile. |
| 3073 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl:: |
| 3074 FromWebContents(web_contents)) { |
| 3075 DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord()); |
| 3076 return impl; |
| 3077 } |
| 3078 } |
| 3079 return nullptr; |
| 3080 } |
| 3081 |
3065 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, | 3082 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, |
3066 const GURL& url) { | 3083 const GURL& url) { |
3067 if (url.is_valid()) { | 3084 if (url.is_valid()) { |
3068 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 3085 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
3069 metric, url); | 3086 metric, url); |
3070 } | 3087 } |
3071 } | 3088 } |
3072 | 3089 |
3073 ScopedVector<content::NavigationThrottle> | 3090 ScopedVector<content::NavigationThrottle> |
3074 ChromeContentBrowserClient::CreateThrottlesForNavigation( | 3091 ChromeContentBrowserClient::CreateThrottlesForNavigation( |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3225 kWebRtcDevSwitchNames, | 3242 kWebRtcDevSwitchNames, |
3226 arraysize(kWebRtcDevSwitchNames)); | 3243 arraysize(kWebRtcDevSwitchNames)); |
3227 } | 3244 } |
3228 } | 3245 } |
3229 #endif // defined(ENABLE_WEBRTC) | 3246 #endif // defined(ENABLE_WEBRTC) |
3230 | 3247 |
3231 std::unique_ptr<content::MemoryCoordinatorDelegate> | 3248 std::unique_ptr<content::MemoryCoordinatorDelegate> |
3232 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { | 3249 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { |
3233 return memory::ChromeMemoryCoordinatorDelegate::Create(); | 3250 return memory::ChromeMemoryCoordinatorDelegate::Create(); |
3234 } | 3251 } |
OLD | NEW |