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 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3047 params.url, | 3048 params.url, |
3048 params.transition); | 3049 params.transition); |
3049 FillNavigateParamsFromOpenURLParams(&nav_params, params); | 3050 FillNavigateParamsFromOpenURLParams(&nav_params, params); |
3050 nav_params.user_gesture = params.user_gesture; | 3051 nav_params.user_gesture = params.user_gesture; |
3051 | 3052 |
3052 Navigate(&nav_params); | 3053 Navigate(&nav_params); |
3053 callback.Run(nav_params.target_contents); | 3054 callback.Run(nav_params.target_contents); |
3054 #endif | 3055 #endif |
3055 } | 3056 } |
3056 | 3057 |
3057 content::PresentationServiceDelegate* | 3058 content::ControllerPresentationServiceDelegate* |
3058 ChromeContentBrowserClient::GetPresentationServiceDelegate( | 3059 ChromeContentBrowserClient::GetControllerPresentationServiceDelegate( |
3059 content::WebContents* web_contents) { | 3060 content::WebContents* web_contents) { |
3060 #if defined(ENABLE_MEDIA_ROUTER) | 3061 #if defined(ENABLE_MEDIA_ROUTER) |
3061 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { | 3062 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
3062 return media_router::PresentationServiceDelegateImpl:: | 3063 return media_router::PresentationServiceDelegateImpl:: |
3063 GetOrCreateForWebContents(web_contents); | 3064 GetOrCreateForWebContents(web_contents); |
3064 } | 3065 } |
3065 #endif // defined(ENABLE_MEDIA_ROUTER) | 3066 #endif // defined(ENABLE_MEDIA_ROUTER) |
3066 return nullptr; | 3067 return nullptr; |
3067 } | 3068 } |
3068 | 3069 |
3070 content::ReceiverPresentationServiceDelegate* | |
3071 ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate( | |
3072 content::WebContents* web_contents) { | |
3073 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { | |
mark a. foltz
2016/11/08 23:40:51
Please guard code that uses media_router:: with #i
zhaobin
2016/11/10 04:13:59
Done.
| |
3074 // ReceiverPresentationServiceDelegateImpl exists only for WebContents | |
3075 // created for offscreen presentations. The WebContents must belong to | |
3076 // an incognito profile. | |
3077 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl:: | |
3078 FromWebContents(web_contents)) { | |
3079 DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord()); | |
mark a. foltz
2016/11/08 23:40:51
API design opinion:
This API is part of content/b
zhaobin
2016/11/10 04:13:59
Done.
| |
3080 return impl; | |
3081 } | |
3082 } | |
3083 return nullptr; | |
3084 } | |
3085 | |
3069 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, | 3086 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, |
3070 const GURL& url) { | 3087 const GURL& url) { |
3071 if (url.is_valid()) { | 3088 if (url.is_valid()) { |
3072 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 3089 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
3073 metric, url); | 3090 metric, url); |
3074 } | 3091 } |
3075 } | 3092 } |
3076 | 3093 |
3077 ScopedVector<content::NavigationThrottle> | 3094 ScopedVector<content::NavigationThrottle> |
3078 ChromeContentBrowserClient::CreateThrottlesForNavigation( | 3095 ChromeContentBrowserClient::CreateThrottlesForNavigation( |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3229 kWebRtcDevSwitchNames, | 3246 kWebRtcDevSwitchNames, |
3230 arraysize(kWebRtcDevSwitchNames)); | 3247 arraysize(kWebRtcDevSwitchNames)); |
3231 } | 3248 } |
3232 } | 3249 } |
3233 #endif // defined(ENABLE_WEBRTC) | 3250 #endif // defined(ENABLE_WEBRTC) |
3234 | 3251 |
3235 std::unique_ptr<content::MemoryCoordinatorDelegate> | 3252 std::unique_ptr<content::MemoryCoordinatorDelegate> |
3236 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { | 3253 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { |
3237 return memory::ChromeMemoryCoordinatorDelegate::Create(); | 3254 return memory::ChromeMemoryCoordinatorDelegate::Create(); |
3238 } | 3255 } |
OLD | NEW |