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

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

Issue 1055503002: Eliminate MediaPlayer & MediaPlayerClient abstractions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 years, 5 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
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebKit.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24 matching lines...) Expand all
35 #include "bindings/core/v8/ScriptController.h" 35 #include "bindings/core/v8/ScriptController.h"
36 #include "core/HTMLNames.h" 36 #include "core/HTMLNames.h"
37 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
38 #include "core/dom/Fullscreen.h" 38 #include "core/dom/Fullscreen.h"
39 #include "core/events/MessageEvent.h" 39 #include "core/events/MessageEvent.h"
40 #include "core/events/MouseEvent.h" 40 #include "core/events/MouseEvent.h"
41 #include "core/events/UIEventWithKeyState.h" 41 #include "core/events/UIEventWithKeyState.h"
42 #include "core/frame/FrameView.h" 42 #include "core/frame/FrameView.h"
43 #include "core/frame/Settings.h" 43 #include "core/frame/Settings.h"
44 #include "core/html/HTMLAppletElement.h" 44 #include "core/html/HTMLAppletElement.h"
45 #include "core/html/HTMLMediaElement.h"
45 #include "core/input/EventHandler.h" 46 #include "core/input/EventHandler.h"
46 #include "core/layout/HitTestResult.h" 47 #include "core/layout/HitTestResult.h"
47 #include "core/loader/DocumentLoader.h" 48 #include "core/loader/DocumentLoader.h"
48 #include "core/loader/FrameLoadRequest.h" 49 #include "core/loader/FrameLoadRequest.h"
49 #include "core/loader/FrameLoader.h" 50 #include "core/loader/FrameLoader.h"
50 #include "core/loader/HistoryItem.h" 51 #include "core/loader/HistoryItem.h"
51 #include "core/page/Page.h" 52 #include "core/page/Page.h"
52 #include "core/page/WindowFeatures.h" 53 #include "core/page/WindowFeatures.h"
53 #include "modules/device_light/DeviceLightController.h" 54 #include "modules/device_light/DeviceLightController.h"
54 #include "modules/device_orientation/DeviceMotionController.h" 55 #include "modules/device_orientation/DeviceMotionController.h"
55 #include "modules/device_orientation/DeviceOrientationController.h" 56 #include "modules/device_orientation/DeviceOrientationController.h"
57 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
56 #include "modules/gamepad/NavigatorGamepad.h" 58 #include "modules/gamepad/NavigatorGamepad.h"
57 #include "modules/serviceworkers/NavigatorServiceWorker.h" 59 #include "modules/serviceworkers/NavigatorServiceWorker.h"
58 #include "modules/storage/DOMWindowStorageController.h" 60 #include "modules/storage/DOMWindowStorageController.h"
59 #include "modules/vr/NavigatorVRDevice.h" 61 #include "modules/vr/NavigatorVRDevice.h"
60 #include "platform/MIMETypeRegistry.h" 62 #include "platform/MIMETypeRegistry.h"
61 #include "platform/RuntimeEnabledFeatures.h" 63 #include "platform/RuntimeEnabledFeatures.h"
62 #include "platform/UserGestureIndicator.h" 64 #include "platform/UserGestureIndicator.h"
63 #include "platform/exported/WrappedResourceRequest.h" 65 #include "platform/exported/WrappedResourceRequest.h"
64 #include "platform/exported/WrappedResourceResponse.h" 66 #include "platform/exported/WrappedResourceResponse.h"
65 #include "platform/network/HTTPParsers.h" 67 #include "platform/network/HTTPParsers.h"
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( 772 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
771 HTMLAppletElement* element, 773 HTMLAppletElement* element,
772 const KURL& /* baseURL */, 774 const KURL& /* baseURL */,
773 const Vector<String>& paramNames, 775 const Vector<String>& paramNames,
774 const Vector<String>& paramValues) 776 const Vector<String>& paramValues)
775 { 777 {
776 return createPlugin(element, KURL(), paramNames, paramValues, 778 return createPlugin(element, KURL(), paramNames, paramValues,
777 "application/x-java-applet", false, FailOnDetachedPlugin); 779 "application/x-java-applet", false, FailOnDetachedPlugin);
778 } 780 }
779 781
782 PassOwnPtr<WebMediaPlayer> FrameLoaderClientImpl::createWebMediaPlayer(
783 HTMLMediaElement* htmlMediaElement,
784 const WebURL& url)
785 {
786 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(
787 htmlMediaElement->document().frame());
788
789 if (!webFrame || !webFrame->client())
790 return nullptr;
791
792 HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMe dia::from(*htmlMediaElement);
793 return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url,
794 htmlMediaElement,
795 &encryptedMedia, encryptedMedia.contentDecryptionModule()));
796 }
797
780 ObjectContentType FrameLoaderClientImpl::objectContentType( 798 ObjectContentType FrameLoaderClientImpl::objectContentType(
781 const KURL& url, 799 const KURL& url,
782 const String& explicitMimeType, 800 const String& explicitMimeType,
783 bool shouldPreferPlugInsForImages) 801 bool shouldPreferPlugInsForImages)
784 { 802 {
785 // This code is based on Apple's implementation from 803 // This code is based on Apple's implementation from
786 // WebCoreSupport/WebFrameBridge.mm. 804 // WebCoreSupport/WebFrameBridge.mm.
787 805
788 String mimeType = explicitMimeType; 806 String mimeType = explicitMimeType;
789 if (mimeType.isEmpty()) { 807 if (mimeType.isEmpty()) {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 976
959 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type) 977 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type)
960 { 978 {
961 if (m_webFrame->client()) { 979 if (m_webFrame->client()) {
962 m_webFrame->client()->suddenTerminationDisablerChanged( 980 m_webFrame->client()->suddenTerminationDisablerChanged(
963 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); 981 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type));
964 } 982 }
965 } 983 }
966 984
967 } // namespace blink 985 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebKit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698