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

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: Rebase and code cleanup Created 5 years, 6 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 /* 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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( 773 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
772 HTMLAppletElement* element, 774 HTMLAppletElement* element,
773 const KURL& /* baseURL */, 775 const KURL& /* baseURL */,
774 const Vector<String>& paramNames, 776 const Vector<String>& paramNames,
775 const Vector<String>& paramValues) 777 const Vector<String>& paramValues)
776 { 778 {
777 return createPlugin(element, KURL(), paramNames, paramValues, 779 return createPlugin(element, KURL(), paramNames, paramValues,
778 "application/x-java-applet", false, FailOnDetachedPlugin); 780 "application/x-java-applet", false, FailOnDetachedPlugin);
779 } 781 }
780 782
783 PassOwnPtr<WebMediaPlayer> FrameLoaderClientImpl::createWebMediaPlayer(
784 HTMLMediaElement* htmlMediaElement,
785 const WebURL& url)
786 {
787 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(
788 htmlMediaElement->document().frame());
789
790 if (!webFrame || !webFrame->client())
791 return nullptr;
792
793 HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMe dia::from(*htmlMediaElement);
794 return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url,
795 static_cast<WebMediaPlayerClient*>(htmlMediaElement),
philipj_slow 2015/07/01 13:49:19 It compiles for me without this cast, but I guess
Srirama 2015/07/03 12:59:02 Done. I would have added it in my initial stages o
796 &encryptedMedia, encryptedMedia.contentDecryptionModule()));
797 }
798
781 ObjectContentType FrameLoaderClientImpl::objectContentType( 799 ObjectContentType FrameLoaderClientImpl::objectContentType(
782 const KURL& url, 800 const KURL& url,
783 const String& explicitMimeType, 801 const String& explicitMimeType,
784 bool shouldPreferPlugInsForImages) 802 bool shouldPreferPlugInsForImages)
785 { 803 {
786 // This code is based on Apple's implementation from 804 // This code is based on Apple's implementation from
787 // WebCoreSupport/WebFrameBridge.mm. 805 // WebCoreSupport/WebFrameBridge.mm.
788 806
789 String mimeType = explicitMimeType; 807 String mimeType = explicitMimeType;
790 if (mimeType.isEmpty()) { 808 if (mimeType.isEmpty()) {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 977
960 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type) 978 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type)
961 { 979 {
962 if (m_webFrame->client()) { 980 if (m_webFrame->client()) {
963 m_webFrame->client()->suddenTerminationDisablerChanged( 981 m_webFrame->client()->suddenTerminationDisablerChanged(
964 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); 982 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type));
965 } 983 }
966 } 984 }
967 985
968 } // namespace blink 986 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698