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

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

Issue 1314413005: [Presentation API] 1-UA presentation support + presenter APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed yuri's comments #16 Created 5 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 #if defined(USE_BROWSER_SPELLCHECKER) 258 #if defined(USE_BROWSER_SPELLCHECKER)
259 #include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h" 259 #include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h"
260 #endif 260 #endif
261 261
262 #if defined(ENABLE_WEBRTC) 262 #if defined(ENABLE_WEBRTC)
263 #include "chrome/browser/media/webrtc_logging_handler_host.h" 263 #include "chrome/browser/media/webrtc_logging_handler_host.h"
264 #endif 264 #endif
265 265
266 #if defined(ENABLE_MEDIA_ROUTER) 266 #if defined(ENABLE_MEDIA_ROUTER)
267 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" 267 #include "chrome/browser/media/router/presentation_service_delegate_impl.h"
268 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp l.h"
268 #endif 269 #endif
269 270
270 using base::FileDescriptor; 271 using base::FileDescriptor;
271 using blink::WebWindowFeatures; 272 using blink::WebWindowFeatures;
272 using content::AccessTokenStore; 273 using content::AccessTokenStore;
273 using content::BrowserThread; 274 using content::BrowserThread;
274 using content::BrowserURLHandler; 275 using content::BrowserURLHandler;
275 using content::ChildProcessSecurityPolicy; 276 using content::ChildProcessSecurityPolicy;
276 using content::QuotaPermissionContext; 277 using content::QuotaPermissionContext;
277 using content::RenderFrameHost; 278 using content::RenderFrameHost;
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2587 browser_context, params, callback); 2588 browser_context, params, callback);
2588 #else 2589 #else
2589 NOTIMPLEMENTED(); 2590 NOTIMPLEMENTED();
2590 #endif 2591 #endif
2591 } 2592 }
2592 2593
2593 content::PresentationServiceDelegate* 2594 content::PresentationServiceDelegate*
2594 ChromeContentBrowserClient::GetPresentationServiceDelegate( 2595 ChromeContentBrowserClient::GetPresentationServiceDelegate(
2595 content::WebContents* web_contents) { 2596 content::WebContents* web_contents) {
2596 #if defined(ENABLE_MEDIA_ROUTER) 2597 #if defined(ENABLE_MEDIA_ROUTER)
2597 if (switches::MediaRouterEnabled() && 2598 if (switches::MediaRouterEnabled()) {
2598 !web_contents->GetBrowserContext()->IsOffTheRecord()) { 2599 // ReceiverPresentationServiceDelegateImpl are for WebContents created for
2599 return media_router::PresentationServiceDelegateImpl:: 2600 // offscreen presentations. The WebContents is from an incognito profile.
2600 GetOrCreateForWebContents(web_contents); 2601 if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl::
2602 FromWebContents(web_contents)) {
2603 DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord());
2604 return impl;
2605 }
2606 // TODO(imcheng): Presentation API is disabled in incognito mode for the
2607 // time being. crbug.com/524795
2608 if (web_contents->GetBrowserContext()->IsOffTheRecord()) {
2609 return nullptr;
2610 } else {
whywhat 2015/10/13 15:21:30 nit: I believe if (a) return b; else return c
imcheng 2015/10/17 01:00:22 Done.
2611 return media_router::PresentationServiceDelegateImpl::
2612 GetOrCreateForWebContents(web_contents);
2613 }
2601 } 2614 }
2602 #endif 2615 #endif
2603 return nullptr; 2616 return nullptr;
2604 } 2617 }
2605 2618
2606 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, 2619 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric,
2607 const GURL& url) { 2620 const GURL& url) {
2608 if (url.is_valid()) { 2621 if (url.is_valid()) {
2609 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 2622 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
2610 metric, url); 2623 metric, url);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 if (channel <= kMaxDisableEncryptionChannel) { 2723 if (channel <= kMaxDisableEncryptionChannel) {
2711 static const char* const kWebRtcDevSwitchNames[] = { 2724 static const char* const kWebRtcDevSwitchNames[] = {
2712 switches::kDisableWebRtcEncryption, 2725 switches::kDisableWebRtcEncryption,
2713 }; 2726 };
2714 to_command_line->CopySwitchesFrom(from_command_line, 2727 to_command_line->CopySwitchesFrom(from_command_line,
2715 kWebRtcDevSwitchNames, 2728 kWebRtcDevSwitchNames,
2716 arraysize(kWebRtcDevSwitchNames)); 2729 arraysize(kWebRtcDevSwitchNames));
2717 } 2730 }
2718 } 2731 }
2719 #endif // defined(ENABLE_WEBRTC) 2732 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698