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

Side by Side Diff: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp

Issue 2475643004: Monitor the intersection of video and viewport. (Closed)
Patch Set: Moved the calculation of intersection ratio to RemotingController. Created 4 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 WebMediaPlayerClient* client) { 766 WebMediaPlayerClient* client) {
767 WebLocalFrameImpl* webFrame = 767 WebLocalFrameImpl* webFrame =
768 WebLocalFrameImpl::fromFrame(htmlMediaElement.document().frame()); 768 WebLocalFrameImpl::fromFrame(htmlMediaElement.document().frame());
769 769
770 if (!webFrame || !webFrame->client()) 770 if (!webFrame || !webFrame->client())
771 return nullptr; 771 return nullptr;
772 772
773 HTMLMediaElementEncryptedMedia& encryptedMedia = 773 HTMLMediaElementEncryptedMedia& encryptedMedia =
774 HTMLMediaElementEncryptedMedia::from(htmlMediaElement); 774 HTMLMediaElementEncryptedMedia::from(htmlMediaElement);
775 WebString sinkId(HTMLMediaElementAudioOutputDevice::sinkId(htmlMediaElement)); 775 WebString sinkId(HTMLMediaElementAudioOutputDevice::sinkId(htmlMediaElement));
776 return wrapUnique(webFrame->client()->createMediaPlayer( 776 std::unique_ptr<WebMediaPlayer> mediaPlayer =
777 source, client, &encryptedMedia, encryptedMedia.contentDecryptionModule(), 777 wrapUnique(webFrame->client()->createMediaPlayer(
778 sinkId)); 778 source, client, &encryptedMedia,
779 encryptedMedia.contentDecryptionModule(), sinkId));
780 WebMediaPlayer::ViewportIntersectionInfo intersectInfo =
781 htmlMediaElement.viewportIntersectInfo();
782 if (!intersectInfo.intersectRect.isEmpty())
783 mediaPlayer->videoViewportIntersectionChanged(intersectInfo);
784 return mediaPlayer;
779 } 785 }
780 786
781 ObjectContentType FrameLoaderClientImpl::getObjectContentType( 787 ObjectContentType FrameLoaderClientImpl::getObjectContentType(
782 const KURL& url, 788 const KURL& url,
783 const String& explicitMimeType, 789 const String& explicitMimeType,
784 bool shouldPreferPlugInsForImages) { 790 bool shouldPreferPlugInsForImages) {
785 // This code is based on Apple's implementation from 791 // This code is based on Apple's implementation from
786 // WebCoreSupport/WebFrameBridge.mm. 792 // WebCoreSupport/WebFrameBridge.mm.
787 793
788 String mimeType = explicitMimeType; 794 String mimeType = explicitMimeType;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 WebDevToolsAgentImpl* FrameLoaderClientImpl::devToolsAgent() { 983 WebDevToolsAgentImpl* FrameLoaderClientImpl::devToolsAgent() {
978 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot()) 984 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot())
979 ->devToolsAgentImpl(); 985 ->devToolsAgentImpl();
980 } 986 }
981 987
982 KURL FrameLoaderClientImpl::overrideFlashEmbedWithHTML(const KURL& url) { 988 KURL FrameLoaderClientImpl::overrideFlashEmbedWithHTML(const KURL& url) {
983 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url)); 989 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url));
984 } 990 }
985 991
986 } // namespace blink 992 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698