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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 #endif | 344 #endif |
345 | 345 |
346 #if BUILDFLAG(ENABLE_WEBRTC) | 346 #if BUILDFLAG(ENABLE_WEBRTC) |
347 #include "chrome/browser/media/audio_debug_recordings_handler.h" | 347 #include "chrome/browser/media/audio_debug_recordings_handler.h" |
348 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" | 348 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" |
349 #endif | 349 #endif |
350 | 350 |
351 #if defined(ENABLE_MEDIA_ROUTER) | 351 #if defined(ENABLE_MEDIA_ROUTER) |
352 #include "chrome/browser/media/router/media_router_feature.h" | 352 #include "chrome/browser/media/router/media_router_feature.h" |
353 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 353 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
354 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp l.h" | |
354 #endif // defined(ENABLE_MEDIA_ROUTER) | 355 #endif // defined(ENABLE_MEDIA_ROUTER) |
355 | 356 |
356 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) && defined(ENABLE_MEDIA_ROUTER) | 357 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) && defined(ENABLE_MEDIA_ROUTER) |
357 #include "chrome/browser/media/cast_remoting_connector.h" | 358 #include "chrome/browser/media/cast_remoting_connector.h" |
358 #endif | 359 #endif |
359 | 360 |
360 | 361 |
361 #if defined(ENABLE_WAYLAND_SERVER) | 362 #if defined(ENABLE_WAYLAND_SERVER) |
362 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" | 363 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" |
363 #endif | 364 #endif |
(...skipping 2766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3130 params.url, | 3131 params.url, |
3131 params.transition); | 3132 params.transition); |
3132 FillNavigateParamsFromOpenURLParams(&nav_params, params); | 3133 FillNavigateParamsFromOpenURLParams(&nav_params, params); |
3133 nav_params.user_gesture = params.user_gesture; | 3134 nav_params.user_gesture = params.user_gesture; |
3134 | 3135 |
3135 Navigate(&nav_params); | 3136 Navigate(&nav_params); |
3136 callback.Run(nav_params.target_contents); | 3137 callback.Run(nav_params.target_contents); |
3137 #endif | 3138 #endif |
3138 } | 3139 } |
3139 | 3140 |
3140 content::PresentationServiceDelegate* | 3141 content::ControllerPresentationServiceDelegate* |
3141 ChromeContentBrowserClient::GetPresentationServiceDelegate( | 3142 ChromeContentBrowserClient::GetControllerPresentationServiceDelegate( |
3142 content::WebContents* web_contents) { | 3143 content::WebContents* web_contents) { |
3143 #if defined(ENABLE_MEDIA_ROUTER) | 3144 #if defined(ENABLE_MEDIA_ROUTER) |
3144 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { | 3145 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
3145 return media_router::PresentationServiceDelegateImpl:: | 3146 return media_router::PresentationServiceDelegateImpl:: |
3146 GetOrCreateForWebContents(web_contents); | 3147 GetOrCreateForWebContents(web_contents); |
3147 } | 3148 } |
3148 #endif // defined(ENABLE_MEDIA_ROUTER) | 3149 #endif // defined(ENABLE_MEDIA_ROUTER) |
3149 return nullptr; | 3150 return nullptr; |
3150 } | 3151 } |
3151 | 3152 |
3153 content::ReceiverPresentationServiceDelegate* | |
3154 ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate( | |
3155 content::WebContents* web_contents) { | |
3156 #if defined(ENABLE_MEDIA_ROUTER) | |
3157 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { | |
3158 // ReceiverPresentationServiceDelegateImpl exists only for WebContents | |
3159 // created for offscreen presentations. The WebContents must belong to | |
3160 // an incognito profile. | |
3161 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl:: | |
3162 FromWebContents(web_contents)) { | |
3163 DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord()); | |
mark a. foltz
2017/01/10 23:05:34
If you're converting this back to a DCHECK, then p
zhaobin
2017/01/11 03:13:37
Done.
| |
3164 return impl; | |
3165 } | |
3166 } | |
3167 #endif // defined(ENABLE_MEDIA_ROUTER) | |
3168 return nullptr; | |
3169 } | |
3170 | |
3152 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, | 3171 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, |
3153 const GURL& url) { | 3172 const GURL& url) { |
3154 if (url.is_valid()) { | 3173 if (url.is_valid()) { |
3155 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 3174 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
3156 metric, url); | 3175 metric, url); |
3157 } | 3176 } |
3158 } | 3177 } |
3159 | 3178 |
3160 ScopedVector<content::NavigationThrottle> | 3179 ScopedVector<content::NavigationThrottle> |
3161 ChromeContentBrowserClient::CreateThrottlesForNavigation( | 3180 ChromeContentBrowserClient::CreateThrottlesForNavigation( |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3362 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { | 3381 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { |
3363 return variations::GetVariationParamValue( | 3382 return variations::GetVariationParamValue( |
3364 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; | 3383 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; |
3365 } | 3384 } |
3366 | 3385 |
3367 bool ChromeContentBrowserClient:: | 3386 bool ChromeContentBrowserClient:: |
3368 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3387 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3369 return variations::GetVariationParamValue( | 3388 return variations::GetVariationParamValue( |
3370 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3389 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3371 } | 3390 } |
OLD | NEW |