Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1420)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: resolve code review comments from Mark Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
326 326
327 #if defined(ENABLE_WEBRTC) 327 #if defined(ENABLE_WEBRTC)
328 #include "chrome/browser/media/audio_debug_recordings_handler.h" 328 #include "chrome/browser/media/audio_debug_recordings_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 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after
3052 params.url, 3053 params.url,
3053 params.transition); 3054 params.transition);
3054 FillNavigateParamsFromOpenURLParams(&nav_params, params); 3055 FillNavigateParamsFromOpenURLParams(&nav_params, params);
3055 nav_params.user_gesture = params.user_gesture; 3056 nav_params.user_gesture = params.user_gesture;
3056 3057
3057 Navigate(&nav_params); 3058 Navigate(&nav_params);
3058 callback.Run(nav_params.target_contents); 3059 callback.Run(nav_params.target_contents);
3059 #endif 3060 #endif
3060 } 3061 }
3061 3062
3062 content::PresentationServiceDelegate* 3063 content::ControllerPresentationServiceDelegate*
3063 ChromeContentBrowserClient::GetPresentationServiceDelegate( 3064 ChromeContentBrowserClient::GetControllerPresentationServiceDelegate(
3064 content::WebContents* web_contents) { 3065 content::WebContents* web_contents) {
3065 #if defined(ENABLE_MEDIA_ROUTER) 3066 #if defined(ENABLE_MEDIA_ROUTER)
3066 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { 3067 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
3067 return media_router::PresentationServiceDelegateImpl:: 3068 return media_router::PresentationServiceDelegateImpl::
3068 GetOrCreateForWebContents(web_contents); 3069 GetOrCreateForWebContents(web_contents);
3069 } 3070 }
3070 #endif // defined(ENABLE_MEDIA_ROUTER) 3071 #endif // defined(ENABLE_MEDIA_ROUTER)
3071 return nullptr; 3072 return nullptr;
3072 } 3073 }
3073 3074
3075 content::ReceiverPresentationServiceDelegate*
3076 ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate(
3077 content::WebContents* web_contents) {
3078 #if defined(ENABLE_MEDIA_ROUTER)
3079 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
3080 // ReceiverPresentationServiceDelegateImpl exists only for WebContents
3081 // created for offscreen presentations. The WebContents must belong to
3082 // an incognito profile.
3083 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl::
3084 FromWebContents(web_contents)) {
3085 if (web_contents->GetBrowserContext()->IsOffTheRecord())
3086 return impl;
3087 }
3088 }
3089 #endif // defined(ENABLE_MEDIA_ROUTER)
3090 return nullptr;
3091 }
3092
3074 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, 3093 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric,
3075 const GURL& url) { 3094 const GURL& url) {
3076 if (url.is_valid()) { 3095 if (url.is_valid()) {
3077 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 3096 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
3078 metric, url); 3097 metric, url);
3079 } 3098 }
3080 } 3099 }
3081 3100
3082 ScopedVector<content::NavigationThrottle> 3101 ScopedVector<content::NavigationThrottle>
3083 ChromeContentBrowserClient::CreateThrottlesForNavigation( 3102 ChromeContentBrowserClient::CreateThrottlesForNavigation(
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
3234 kWebRtcDevSwitchNames, 3253 kWebRtcDevSwitchNames,
3235 arraysize(kWebRtcDevSwitchNames)); 3254 arraysize(kWebRtcDevSwitchNames));
3236 } 3255 }
3237 } 3256 }
3238 #endif // defined(ENABLE_WEBRTC) 3257 #endif // defined(ENABLE_WEBRTC)
3239 3258
3240 std::unique_ptr<content::MemoryCoordinatorDelegate> 3259 std::unique_ptr<content::MemoryCoordinatorDelegate>
3241 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { 3260 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() {
3242 return memory::ChromeMemoryCoordinatorDelegate::Create(); 3261 return memory::ChromeMemoryCoordinatorDelegate::Create();
3243 } 3262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698