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

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 jam Created 4 years 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 #endif 337 #endif
338 338
339 #if BUILDFLAG(ENABLE_WEBRTC) 339 #if BUILDFLAG(ENABLE_WEBRTC)
340 #include "chrome/browser/media/audio_debug_recordings_handler.h" 340 #include "chrome/browser/media/audio_debug_recordings_handler.h"
341 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" 341 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h"
342 #endif 342 #endif
343 343
344 #if defined(ENABLE_MEDIA_ROUTER) 344 #if defined(ENABLE_MEDIA_ROUTER)
345 #include "chrome/browser/media/router/media_router_feature.h" 345 #include "chrome/browser/media/router/media_router_feature.h"
346 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" 346 #include "chrome/browser/media/router/presentation_service_delegate_impl.h"
347 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp l.h"
347 #endif // defined(ENABLE_MEDIA_ROUTER) 348 #endif // defined(ENABLE_MEDIA_ROUTER)
348 349
349 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) && defined(ENABLE_MEDIA_ROUTER) 350 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) && defined(ENABLE_MEDIA_ROUTER)
350 #include "chrome/browser/media/cast_remoting_connector.h" 351 #include "chrome/browser/media/cast_remoting_connector.h"
351 #endif 352 #endif
352 353
353 354
354 #if defined(ENABLE_WAYLAND_SERVER) 355 #if defined(ENABLE_WAYLAND_SERVER)
355 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" 356 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h"
356 #endif 357 #endif
(...skipping 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after
3126 params.url, 3127 params.url,
3127 params.transition); 3128 params.transition);
3128 FillNavigateParamsFromOpenURLParams(&nav_params, params); 3129 FillNavigateParamsFromOpenURLParams(&nav_params, params);
3129 nav_params.user_gesture = params.user_gesture; 3130 nav_params.user_gesture = params.user_gesture;
3130 3131
3131 Navigate(&nav_params); 3132 Navigate(&nav_params);
3132 callback.Run(nav_params.target_contents); 3133 callback.Run(nav_params.target_contents);
3133 #endif 3134 #endif
3134 } 3135 }
3135 3136
3136 content::PresentationServiceDelegate* 3137 content::ControllerPresentationServiceDelegate*
3137 ChromeContentBrowserClient::GetPresentationServiceDelegate( 3138 ChromeContentBrowserClient::GetControllerPresentationServiceDelegate(
3138 content::WebContents* web_contents) { 3139 content::WebContents* web_contents) {
3139 #if defined(ENABLE_MEDIA_ROUTER) 3140 #if defined(ENABLE_MEDIA_ROUTER)
3140 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { 3141 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
3141 return media_router::PresentationServiceDelegateImpl:: 3142 return media_router::PresentationServiceDelegateImpl::
3142 GetOrCreateForWebContents(web_contents); 3143 GetOrCreateForWebContents(web_contents);
3143 } 3144 }
3144 #endif // defined(ENABLE_MEDIA_ROUTER) 3145 #endif // defined(ENABLE_MEDIA_ROUTER)
3145 return nullptr; 3146 return nullptr;
3146 } 3147 }
3147 3148
3149 content::ReceiverPresentationServiceDelegate*
3150 ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate(
3151 content::WebContents* web_contents) {
3152 #if defined(ENABLE_MEDIA_ROUTER)
3153 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
3154 // ReceiverPresentationServiceDelegateImpl exists only for WebContents
3155 // created for offscreen presentations. The WebContents must belong to
3156 // an incognito profile.
3157 auto* impl =
3158 media_router::ReceiverPresentationServiceDelegateImpl::FromWebContents(
3159 web_contents);
3160 if (impl && web_contents->GetBrowserContext()->IsOffTheRecord())
dcheng 2017/01/06 11:54:22 I would expect the IsOffTheRecord() bit to a be a
zhaobin 2017/01/10 01:39:17 Mark suggests not using DCHECK in patch set 1: ma
dcheng 2017/01/10 06:46:58 It's not really that weird, IMO. If we shouldn't h
zhaobin 2017/01/10 21:49:54 Done.
3161 return impl;
3162 }
3163 #endif // defined(ENABLE_MEDIA_ROUTER)
3164 return nullptr;
3165 }
3166
3148 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, 3167 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric,
3149 const GURL& url) { 3168 const GURL& url) {
3150 if (url.is_valid()) { 3169 if (url.is_valid()) {
3151 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 3170 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
3152 metric, url); 3171 metric, url);
3153 } 3172 }
3154 } 3173 }
3155 3174
3156 ScopedVector<content::NavigationThrottle> 3175 ScopedVector<content::NavigationThrottle>
3157 ChromeContentBrowserClient::CreateThrottlesForNavigation( 3176 ChromeContentBrowserClient::CreateThrottlesForNavigation(
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
3347 GetBrowserSchedulerWorkerPoolParamsFromVariations(); 3366 GetBrowserSchedulerWorkerPoolParamsFromVariations();
3348 *index_to_traits_callback = base::Bind(&task_scheduler_util::initialization:: 3367 *index_to_traits_callback = base::Bind(&task_scheduler_util::initialization::
3349 BrowserWorkerPoolIndexForTraits); 3368 BrowserWorkerPoolIndexForTraits);
3350 } 3369 }
3351 3370
3352 void ChromeContentBrowserClient:: 3371 void ChromeContentBrowserClient::
3353 PerformExperimentalTaskSchedulerRedirections() { 3372 PerformExperimentalTaskSchedulerRedirections() {
3354 task_scheduler_util::variations:: 3373 task_scheduler_util::variations::
3355 MaybePerformBrowserTaskSchedulerRedirection(); 3374 MaybePerformBrowserTaskSchedulerRedirection();
3356 } 3375 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698