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

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

Issue 2343013002: [Presentation API] (MR side) 1-UA: notify receiver page when receiver connection becomes available (Closed)
Patch Set: resolve code review comments from Derek Created 4 years, 2 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
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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 #if defined(ENABLE_WEBRTC) 315 #if defined(ENABLE_WEBRTC)
316 #include "chrome/browser/media/audio_debug_recordings_handler.h" 316 #include "chrome/browser/media/audio_debug_recordings_handler.h"
317 #include "chrome/browser/media/webrtc/webrtc_event_log_handler.h" 317 #include "chrome/browser/media/webrtc/webrtc_event_log_handler.h"
318 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h" 318 #include "chrome/browser/media/webrtc/webrtc_logging_handler_host.h"
319 #endif 319 #endif
320 320
321 #if defined(ENABLE_MEDIA_ROUTER) 321 #if defined(ENABLE_MEDIA_ROUTER)
322 #include "chrome/browser/media/router/media_router_feature.h" 322 #include "chrome/browser/media/router/media_router_feature.h"
323 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" 323 #include "chrome/browser/media/router/presentation_service_delegate_impl.h"
324 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp l.h"
324 #endif 325 #endif
325 326
326 #if defined(ENABLE_WAYLAND_SERVER) 327 #if defined(ENABLE_WAYLAND_SERVER)
327 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h" 328 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h"
328 #endif 329 #endif
329 330
330 #if defined(ENABLE_MOJO_MEDIA) 331 #if defined(ENABLE_MOJO_MEDIA)
331 #include "chrome/browser/media/output_protection_impl.h" 332 #include "chrome/browser/media/output_protection_impl.h"
332 #endif 333 #endif
333 334
(...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 Navigate(&nav_params); 2997 Navigate(&nav_params);
2997 callback.Run(nav_params.target_contents); 2998 callback.Run(nav_params.target_contents);
2998 #endif 2999 #endif
2999 } 3000 }
3000 3001
3001 content::PresentationServiceDelegate* 3002 content::PresentationServiceDelegate*
3002 ChromeContentBrowserClient::GetPresentationServiceDelegate( 3003 ChromeContentBrowserClient::GetPresentationServiceDelegate(
3003 content::WebContents* web_contents) { 3004 content::WebContents* web_contents) {
3004 #if defined(ENABLE_MEDIA_ROUTER) 3005 #if defined(ENABLE_MEDIA_ROUTER)
3005 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { 3006 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
3007 // ReceiverPresentationServiceDelegateImpl are for WebContents created for
mark a. foltz 2016/10/04 00:32:20 ...exist only for WebContents
zhaobin 2016/10/04 02:42:59 Done.
3008 // offscreen presentations. The WebContents is from an incognito profile.
mark a. foltz 2016/10/04 00:32:20 The WebContents must belong to an...
zhaobin 2016/10/04 02:42:59 Done.
3009 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl::
mark a. foltz 2016/10/04 00:32:20 Does this imply that the same WebContents cannot b
zhaobin 2016/10/04 02:42:59 Done.
3010 FromWebContents(web_contents)) {
3011 DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord());
3012 return impl;
3013 }
3006 return media_router::PresentationServiceDelegateImpl:: 3014 return media_router::PresentationServiceDelegateImpl::
3007 GetOrCreateForWebContents(web_contents); 3015 GetOrCreateForWebContents(web_contents);
3008 } 3016 }
3009 #endif // defined(ENABLE_MEDIA_ROUTER) 3017 #endif // defined(ENABLE_MEDIA_ROUTER)
3010 return nullptr; 3018 return nullptr;
3011 } 3019 }
3012 3020
3013 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, 3021 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric,
3014 const GURL& url) { 3022 const GURL& url) {
3015 if (url.is_valid()) { 3023 if (url.is_valid()) {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
3179 if (channel <= kMaxDisableEncryptionChannel) { 3187 if (channel <= kMaxDisableEncryptionChannel) {
3180 static const char* const kWebRtcDevSwitchNames[] = { 3188 static const char* const kWebRtcDevSwitchNames[] = {
3181 switches::kDisableWebRtcEncryption, 3189 switches::kDisableWebRtcEncryption,
3182 }; 3190 };
3183 to_command_line->CopySwitchesFrom(from_command_line, 3191 to_command_line->CopySwitchesFrom(from_command_line,
3184 kWebRtcDevSwitchNames, 3192 kWebRtcDevSwitchNames,
3185 arraysize(kWebRtcDevSwitchNames)); 3193 arraysize(kWebRtcDevSwitchNames));
3186 } 3194 }
3187 } 3195 }
3188 #endif // defined(ENABLE_WEBRTC) 3196 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698