Add stubbed out PluginView class
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jul 2010 18:34:15 +0000 (18:34 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jul 2010 18:34:15 +0000 (18:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=41879

Reviewed by Sam Weinig.

WebCore:

Export functions needed by WebKit2.

* WebCore.exp.in:

WebKit2:

* WebKit2.xcodeproj/project.pbxproj:
Add PluginView.cpp and PluginView.h

* WebProcess/Plugins/PluginView.cpp: Added.
(WebKit::PluginView::PluginView):
(WebKit::PluginView::~PluginView):
(WebKit::PluginView::setFrameRect):
(WebKit::PluginView::paint):
(WebKit::PluginView::viewGeometryDidChange):
(WebKit::PluginView::invalidateRect):
Stub out these functions.

* WebProcess/Plugins/PluginView.h: Added.
(WebKit::PluginView::create):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createPlugin):
Create a plug-in view.

* win/WebKit2.vcproj:
Add PluginView.cpp and PluginView.h.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@62809 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/WebCore.exp.in
WebKit2/ChangeLog
WebKit2/WebKit2.xcodeproj/project.pbxproj
WebKit2/WebProcess/Plugins/PluginView.cpp [new file with mode: 0644]
WebKit2/WebProcess/Plugins/PluginView.h [new file with mode: 0644]
WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
WebKit2/win/WebKit2.vcproj

index 3136a2d865ac18df047dda4f9848dd26dae9cde1..bcbd79eb275d5dc49370d79dc0dd6a6859d621a3 100644 (file)
@@ -1,3 +1,14 @@
+2010-07-08  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add stubbed out PluginView class
+        https://bugs.webkit.org/show_bug.cgi?id=41879
+
+        Export functions needed by WebKit2.
+
+        * WebCore.exp.in:
+
 2010-07-08  Ben Murdoch  <benm@google.com>
 
         Reviewed by Pavel Feldman.
index bab7a1b5ee926d25560a06cf78aae15a661e18bb..744f0efe3aaa6cc70b76c0bfc0f7332147974d59 100644 (file)
@@ -594,6 +594,7 @@ __ZN7WebCore6WidgetD2Ev
 __ZN7WebCore7Console21shouldPrintExceptionsEv
 __ZN7WebCore7Console24setShouldPrintExceptionsEb
 __ZN7WebCore7IntRect5uniteERKS0_
+__ZN7WebCore7IntRect9intersectERKS0_
 __ZN7WebCore7IntRectC1ERKNS_9FloatRectE
 __ZN7WebCore7IntSizeC1ERK7_NSSize
 __ZN7WebCore7cookiesEPKNS_8DocumentERKNS_4KURLE
@@ -850,6 +851,8 @@ __ZNK7WebCore14RenderListItem10markerTextEv
 __ZNK7WebCore14ResourceHandle10connectionEv
 __ZNK7WebCore14ResourceLoader11frameLoaderEv
 __ZNK7WebCore14SecurityOrigin5equalEPKS0_
+__ZNK7WebCore15GraphicsContext15platformContextEv
+__ZNK7WebCore15GraphicsContext16paintingDisabledEv
 __ZNK7WebCore15ProgressTracker17estimatedProgressEv
 __ZNK7WebCore15ResourceRequest12nsURLRequestEv
 __ZNK7WebCore15VisiblePosition14characterAfterEv
index 8cecff971bea73db3b07524a404c6134fbd32ae3..0292a4a42bad2f2d2d33955dd05844f0839b7f41 100644 (file)
@@ -1,3 +1,31 @@
+2010-07-08  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add stubbed out PluginView class
+        https://bugs.webkit.org/show_bug.cgi?id=41879
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add PluginView.cpp and PluginView.h
+
+        * WebProcess/Plugins/PluginView.cpp: Added.
+        (WebKit::PluginView::PluginView):
+        (WebKit::PluginView::~PluginView):
+        (WebKit::PluginView::setFrameRect):
+        (WebKit::PluginView::paint):
+        (WebKit::PluginView::viewGeometryDidChange):
+        (WebKit::PluginView::invalidateRect):
+        Stub out these functions.
+
+        * WebProcess/Plugins/PluginView.h: Added.
+        (WebKit::PluginView::create):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createPlugin):
+        Create a plug-in view.
+        
+        * win/WebKit2.vcproj:
+        Add PluginView.cpp and PluginView.h.
+
 2010-07-08  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by Adam Roben.
index 847dfadcd084fa283a734a239b98d62b1f61dc16..7eba1db5c74a3c8408ff571d646340887fd5a5af 100644 (file)
@@ -46,6 +46,8 @@
                1A6FA02011E1528700DB1371 /* WebProcessMain.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6FA01F11E1528700DB1371 /* WebProcessMain.h */; };
                1A6FA31111E3921E00DB1371 /* MainMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA31011E3921E00DB1371 /* MainMac.cpp */; };
                1A6FA31611E3923600DB1371 /* WebKitMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA31511E3923600DB1371 /* WebKitMain.cpp */; };
+               1A6FB7AE11E64B6800DB1371 /* PluginView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FB7AC11E64B6800DB1371 /* PluginView.cpp */; };
+               1A6FB7AF11E64B6800DB1371 /* PluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6FB7AD11E64B6800DB1371 /* PluginView.h */; };
                1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
                1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
                1AADE6FF10D855FC00D3D63D /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AADE6FE10D855FC00D3D63D /* ApplicationServices.framework */; };
                1A6FA01F11E1528700DB1371 /* WebProcessMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessMain.h; sourceTree = "<group>"; };
                1A6FA31011E3921E00DB1371 /* MainMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MainMac.cpp; path = mac/MainMac.cpp; sourceTree = "<group>"; };
                1A6FA31511E3923600DB1371 /* WebKitMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitMain.cpp; sourceTree = "<group>"; };
+               1A6FB7AC11E64B6800DB1371 /* PluginView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginView.cpp; path = Plugins/PluginView.cpp; sourceTree = "<group>"; };
+               1A6FB7AD11E64B6800DB1371 /* PluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginView.h; path = Plugins/PluginView.h; sourceTree = "<group>"; };
                1AA1C79A100E7FC50078DEBC /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
                        path = mac;
                        sourceTree = "<group>";
                };
+               1A6FB7AA11E64B4900DB1371 /* Plugins */ = {
+                       isa = PBXGroup;
+                       children = (
+                               1A6FB7AC11E64B6800DB1371 /* PluginView.cpp */,
+                               1A6FB7AD11E64B6800DB1371 /* PluginView.h */,
+                       );
+                       name = Plugins;
+                       sourceTree = "<group>";
+               };
                1A7E814E1152D2240003695B /* mac */ = {
                        isa = PBXGroup;
                        children = (
                        isa = PBXGroup;
                        children = (
                                1A6FA01C11E1526300DB1371 /* mac */,
+                               1A6FB7AA11E64B4900DB1371 /* Plugins */,
                                BC204EDF11C83E72008F3375 /* InjectedBundle */,
                                BC032D5D10F437220058C15A /* WebCoreSupport */,
                                BC032D5E10F4372B0058C15A /* WebPage */,
                                BCA8C9DC11E4086500812FB7 /* WebBackForwardControllerClient.h in Headers */,
                                BC72B9FB11E6476B001EB4EA /* WebBackForwardListProxy.h in Headers */,
                                BC72BA1E11E64907001EB4EA /* WebBackForwardList.h in Headers */,
+                               1A6FB7AF11E64B6800DB1371 /* PluginView.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BCA8C9DD11E4086500812FB7 /* WebBackForwardControllerClient.cpp in Sources */,
                                BC72B9FA11E6476B001EB4EA /* WebBackForwardListProxy.cpp in Sources */,
                                BC72BA1D11E64907001EB4EA /* WebBackForwardList.cpp in Sources */,
+                               1A6FB7AE11E64B6800DB1371 /* PluginView.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/WebKit2/WebProcess/Plugins/PluginView.cpp b/WebKit2/WebProcess/Plugins/PluginView.cpp
new file mode 100644 (file)
index 0000000..f97a640
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PluginView.h"
+
+#include "Plugin.h"
+#include <WebCore/GraphicsContext.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PluginView::PluginView()
+{
+}
+
+PluginView::~PluginView()
+{
+}
+
+void PluginView::setFrameRect(const WebCore::IntRect& rect)
+{
+    Widget::setFrameRect(rect);
+    viewGeometryDidChange();
+}
+
+void PluginView::paint(GraphicsContext* context, const IntRect& dirtyRect)
+{
+    if (context->paintingDisabled())
+        return;
+    
+    IntRect paintRect = intersection(dirtyRect, frameRect());
+    if (paintRect.isEmpty())
+        return;
+
+#if PLATFORM(MAC)
+    CGContextRef cgContext = context->platformContext();
+    CGContextSaveGState(cgContext);
+    
+    CGColorRef redColor = CGColorCreateGenericRGB(1, 0, 0, 1);
+    CGContextSetFillColorWithColor(cgContext, redColor);
+    CGContextFillRect(cgContext, paintRect);
+    CGColorRelease(redColor);
+#endif 
+}
+
+void PluginView::viewGeometryDidChange()
+{
+}
+
+void PluginView::invalidateRect(const IntRect&)
+{
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/Plugins/PluginView.h b/WebKit2/WebProcess/Plugins/PluginView.h
new file mode 100644 (file)
index 0000000..d00440c
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginView_h
+#define PluginView_h
+
+#include <WebCore/Widget.h>
+
+// FIXME: Eventually this should move to WebCore.
+
+namespace WebKit {
+
+class Plugin;
+
+class PluginView : public WebCore::Widget {
+public:
+    static PassRefPtr<PluginView> create()
+    {
+        return adoptRef(new PluginView());
+    }
+
+private:
+    PluginView();
+    virtual ~PluginView();
+
+    void viewGeometryDidChange();
+
+    // WebCore::Widget
+    virtual void setFrameRect(const WebCore::IntRect&);
+    virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&);
+    virtual void invalidateRect(const WebCore::IntRect&);
+};
+
+} // namespace WebKit
+
+#endif // PluginView_h
index 002f1e9f3f6d519fc00e70fd5379010ab631982e..4bcc0488ea4a9e6bb049b3576ffdc6c1a2323f86 100644 (file)
@@ -26,6 +26,7 @@
 #include "WebFrameLoaderClient.h"
 
 #include "NotImplemented.h"
+#include "PluginView.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebErrors.h"
 #include "WebFrame.h"
@@ -765,7 +766,7 @@ void WebFrameLoaderClient::didTransferChildFrameToNewDocument()
 PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually)
 {
     notImplemented();
-    return 0;
+    return PluginView::create();
 }
 
 void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
index 05bd7b045106a9e2aff6a7e2d12dc2e32c0e477d..c729b369003b5a7d0449fb5fcdbe69673ee2fc8a 100755 (executable)
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"\r
+                               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"\r
                                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit2;BUILDING_WEBKIT2"\r
                                UsePrecompiledHeader="2"\r
                                PrecompiledHeaderThrough="WebKit2Prefix.h"\r
                                        </File>\r
                                </Filter>\r
                        </Filter>\r
+                       <Filter\r
+                               Name="Plugins"\r
+                               >\r
+                               <File\r
+                                       RelativePath="..\WebProcess\Plugins\PluginView.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\WebProcess\Plugins\PluginView.h"\r
+                                       >\r
+                               </File>\r
+                       </Filter>\r
                </Filter>\r
                <Filter\r
                        Name="UIProcess"\r