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

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

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: fix windows compile error Created 3 years, 11 months 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
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/media/router/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 #endif 346 #endif
347 347
348 #if BUILDFLAG(ENABLE_WEBRTC) 348 #if BUILDFLAG(ENABLE_WEBRTC)
349 #include "chrome/browser/media/audio_debug_recordings_handler.h" 349 #include "chrome/browser/media/audio_debug_recordings_handler.h"
350 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" 350 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h"
351 #endif 351 #endif
352 352
353 #if defined(ENABLE_MEDIA_ROUTER) 353 #if defined(ENABLE_MEDIA_ROUTER)
354 #include "chrome/browser/media/router/media_router_feature.h" 354 #include "chrome/browser/media/router/media_router_feature.h"
355 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" 355 #include "chrome/browser/media/router/presentation_service_delegate_impl.h"
356 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp l.h"
356 #endif // defined(ENABLE_MEDIA_ROUTER) 357 #endif // defined(ENABLE_MEDIA_ROUTER)
357 358
358 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) && defined(ENABLE_MEDIA_ROUTER) 359 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) && defined(ENABLE_MEDIA_ROUTER)
359 #include "chrome/browser/media/cast_remoting_connector.h" 360 #include "chrome/browser/media/cast_remoting_connector.h"
360 #endif 361 #endif
361 362
362 363
363 #if defined(ENABLE_WAYLAND_SERVER) 364 #if defined(ENABLE_WAYLAND_SERVER)
364 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" 365 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h"
365 #endif 366 #endif
(...skipping 2748 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 params.url, 3115 params.url,
3115 params.transition); 3116 params.transition);
3116 FillNavigateParamsFromOpenURLParams(&nav_params, params); 3117 FillNavigateParamsFromOpenURLParams(&nav_params, params);
3117 nav_params.user_gesture = params.user_gesture; 3118 nav_params.user_gesture = params.user_gesture;
3118 3119
3119 Navigate(&nav_params); 3120 Navigate(&nav_params);
3120 callback.Run(nav_params.target_contents); 3121 callback.Run(nav_params.target_contents);
3121 #endif 3122 #endif
3122 } 3123 }
3123 3124
3124 content::PresentationServiceDelegate* 3125 content::ControllerPresentationServiceDelegate*
3125 ChromeContentBrowserClient::GetPresentationServiceDelegate( 3126 ChromeContentBrowserClient::GetControllerPresentationServiceDelegate(
3126 content::WebContents* web_contents) { 3127 content::WebContents* web_contents) {
3127 #if defined(ENABLE_MEDIA_ROUTER) 3128 #if defined(ENABLE_MEDIA_ROUTER)
3128 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { 3129 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
3129 return media_router::PresentationServiceDelegateImpl:: 3130 return media_router::PresentationServiceDelegateImpl::
3130 GetOrCreateForWebContents(web_contents); 3131 GetOrCreateForWebContents(web_contents);
3131 } 3132 }
3132 #endif // defined(ENABLE_MEDIA_ROUTER) 3133 #endif // defined(ENABLE_MEDIA_ROUTER)
3133 return nullptr; 3134 return nullptr;
3134 } 3135 }
3135 3136
3137 content::ReceiverPresentationServiceDelegate*
3138 ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate(
3139 content::WebContents* web_contents) {
3140 #if defined(ENABLE_MEDIA_ROUTER)
3141 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
3142 // ReceiverPresentationServiceDelegateImpl exists only for WebContents
3143 // created for offscreen presentations. The WebContents must belong to
3144 // an incognito profile.
3145 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl::
3146 FromWebContents(web_contents)) {
3147 DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord());
3148 return impl;
3149 }
3150 }
3151 #endif // defined(ENABLE_MEDIA_ROUTER)
3152 return nullptr;
3153 }
3154
3136 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, 3155 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric,
3137 const GURL& url) { 3156 const GURL& url) {
3138 if (url.is_valid()) { 3157 if (url.is_valid()) {
3139 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 3158 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
3140 metric, url); 3159 metric, url);
3141 } 3160 }
3142 } 3161 }
3143 3162
3144 ScopedVector<content::NavigationThrottle> 3163 ScopedVector<content::NavigationThrottle>
3145 ChromeContentBrowserClient::CreateThrottlesForNavigation( 3164 ChromeContentBrowserClient::CreateThrottlesForNavigation(
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
3346 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { 3365 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() {
3347 return variations::GetVariationParamValue( 3366 return variations::GetVariationParamValue(
3348 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; 3367 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true";
3349 } 3368 }
3350 3369
3351 bool ChromeContentBrowserClient:: 3370 bool ChromeContentBrowserClient::
3352 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3371 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3353 return variations::GetVariationParamValue( 3372 return variations::GetVariationParamValue(
3354 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3373 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3355 } 3374 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/media/router/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698