Add a Plugin abstract base class and a DummyPlugin that implements it
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jul 2010 18:59:32 +0000 (18:59 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jul 2010 18:59:32 +0000 (18:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=41885

Reviewed by Sam Weinig.

* WebKit2.xcodeproj/project.pbxproj:
Add files.

* WebProcess/Plugins/DummyPlugin.cpp: Added.
(WebKit::DummyPlugin::paint):
Paint a red rectangle.

* WebProcess/Plugins/Plugin.cpp: Added.
* WebProcess/Plugins/Plugin.h: Added.
Add Plugin, an abstract baseclass.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::PluginView):
(WebKit::PluginView::~PluginView):
(WebKit::PluginView::paint):
(WebKit::PluginView::viewGeometryDidChange):
* WebProcess/Plugins/PluginView.h:
(WebKit::PluginView::create):
Add a Plugin member function and forward PluginView calls to it.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createPlugin):
Make a DummyPlugin and pass it to the PluginView.

* win/WebKit2.vcproj:
Add files.

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

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

index 0292a4a42bad2f2d2d33955dd05844f0839b7f41..3ea068670dfad1cfd8fd752637be2dc78d0511b6 100644 (file)
@@ -1,3 +1,37 @@
+2010-07-08  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add a Plugin abstract base class and a DummyPlugin that implements it
+        https://bugs.webkit.org/show_bug.cgi?id=41885
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add files.
+
+        * WebProcess/Plugins/DummyPlugin.cpp: Added.
+        (WebKit::DummyPlugin::paint):
+        Paint a red rectangle.
+        
+        * WebProcess/Plugins/Plugin.cpp: Added.
+        * WebProcess/Plugins/Plugin.h: Added.
+        Add Plugin, an abstract baseclass.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::PluginView):
+        (WebKit::PluginView::~PluginView):
+        (WebKit::PluginView::paint):
+        (WebKit::PluginView::viewGeometryDidChange):
+        * WebProcess/Plugins/PluginView.h:
+        (WebKit::PluginView::create):
+        Add a Plugin member function and forward PluginView calls to it.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createPlugin):
+        Make a DummyPlugin and pass it to the PluginView.
+
+        * win/WebKit2.vcproj:
+        Add files.
+        
 2010-07-08  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam Weinig.
index 7eba1db5c74a3c8408ff571d646340887fd5a5af..3e5baa137900c24a98ea61d0036764ccddd1c662 100644 (file)
                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 */; };
+               1A6FB7D211E651E200DB1371 /* Plugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FB7D011E651E200DB1371 /* Plugin.cpp */; };
+               1A6FB7D311E651E200DB1371 /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6FB7D111E651E200DB1371 /* Plugin.h */; };
+               1A6FB7E611E6530500DB1371 /* DummyPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6FB7E411E6530500DB1371 /* DummyPlugin.h */; };
+               1A6FB7E711E6530500DB1371 /* DummyPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FB7E511E6530500DB1371 /* DummyPlugin.cpp */; };
                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>"; };
+               1A6FB7AC11E64B6800DB1371 /* PluginView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginView.cpp; sourceTree = "<group>"; };
+               1A6FB7AD11E64B6800DB1371 /* PluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginView.h; sourceTree = "<group>"; };
+               1A6FB7D011E651E200DB1371 /* Plugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Plugin.cpp; sourceTree = "<group>"; };
+               1A6FB7D111E651E200DB1371 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = "<group>"; };
+               1A6FB7E411E6530500DB1371 /* DummyPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DummyPlugin.h; sourceTree = "<group>"; };
+               1A6FB7E511E6530500DB1371 /* DummyPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DummyPlugin.cpp; 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>"; };
                1A6FB7AA11E64B4900DB1371 /* Plugins */ = {
                        isa = PBXGroup;
                        children = (
+                               1A6FB7E511E6530500DB1371 /* DummyPlugin.cpp */,
+                               1A6FB7E411E6530500DB1371 /* DummyPlugin.h */,
+                               1A6FB7D011E651E200DB1371 /* Plugin.cpp */,
+                               1A6FB7D111E651E200DB1371 /* Plugin.h */,
                                1A6FB7AC11E64B6800DB1371 /* PluginView.cpp */,
                                1A6FB7AD11E64B6800DB1371 /* PluginView.h */,
                        );
-                       name = Plugins;
+                       path = Plugins;
                        sourceTree = "<group>";
                };
                1A7E814E1152D2240003695B /* mac */ = {
                                BC72B9FB11E6476B001EB4EA /* WebBackForwardListProxy.h in Headers */,
                                BC72BA1E11E64907001EB4EA /* WebBackForwardList.h in Headers */,
                                1A6FB7AF11E64B6800DB1371 /* PluginView.h in Headers */,
+                               1A6FB7D311E651E200DB1371 /* Plugin.h in Headers */,
+                               1A6FB7E611E6530500DB1371 /* DummyPlugin.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BC72B9FA11E6476B001EB4EA /* WebBackForwardListProxy.cpp in Sources */,
                                BC72BA1D11E64907001EB4EA /* WebBackForwardList.cpp in Sources */,
                                1A6FB7AE11E64B6800DB1371 /* PluginView.cpp in Sources */,
+                               1A6FB7D211E651E200DB1371 /* Plugin.cpp in Sources */,
+                               1A6FB7E711E6530500DB1371 /* DummyPlugin.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/WebKit2/WebProcess/Plugins/DummyPlugin.cpp b/WebKit2/WebProcess/Plugins/DummyPlugin.cpp
new file mode 100644 (file)
index 0000000..d94336d
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * 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 "DummyPlugin.h"
+
+#include <WebCore/GraphicsContext.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+DummyPlugin::DummyPlugin()
+{
+}
+
+void DummyPlugin::initialize(const String& mimeType, const KURL&, bool loadManually)
+{
+}
+    
+void DummyPlugin::destroy()
+{
+}
+    
+void DummyPlugin::paint(GraphicsContext* context, const IntRect& dirtyRect)
+{
+#if PLATFORM(MAC)
+    CGContextRef cgContext = context->platformContext();
+    CGContextSaveGState(cgContext);
+    
+    CGColorRef redColor = CGColorCreateGenericRGB(1, 0, 0, 1);
+    CGContextSetFillColorWithColor(cgContext, redColor);
+    CGContextFillRect(cgContext, dirtyRect);
+    CGColorRelease(redColor);
+#endif    
+}
+    
+void DummyPlugin::geometryDidChange(const IntRect& frameRect)
+{
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/Plugins/DummyPlugin.h b/WebKit2/WebProcess/Plugins/DummyPlugin.h
new file mode 100644 (file)
index 0000000..44a7c90
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * 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 DummyPlugin_h
+#define DummyPlugin_h
+
+#include "Plugin.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+class DummyPlugin : public Plugin {
+public:
+    static PassRefPtr<DummyPlugin> create()
+    {
+        return adoptRef(new DummyPlugin);
+    }
+
+private:
+    DummyPlugin();
+
+    // Plugin
+    virtual void initialize(const WebCore::String& mimeType, const WebCore::KURL&, bool loadManually);
+    virtual void destroy();
+    virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& dirtyRect);
+    virtual void geometryDidChange(const WebCore::IntRect& frameRect);
+}
+
+} // namespace WebKit
+
+#endif // DummyPlugin_h
diff --git a/WebKit2/WebProcess/Plugins/Plugin.cpp b/WebKit2/WebProcess/Plugins/Plugin.cpp
new file mode 100644 (file)
index 0000000..12650e0
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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 "Plugin.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+Plugin::Plugin()
+{
+}
+
+Plugin::~Plugin()
+{
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/Plugins/Plugin.h b/WebKit2/WebProcess/Plugins/Plugin.h
new file mode 100644 (file)
index 0000000..703571c
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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 Plugin_h
+#define Plugin_h
+
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+    class GraphicsContext;
+    class IntRect;
+    class KURL;
+    class String;
+}
+
+namespace WebKit {
+
+class Plugin : public RefCounted<Plugin> {
+public:
+    virtual ~Plugin();
+    
+    virtual void initialize(const WebCore::String& mimeType, const WebCore::KURL&, bool loadManually) = 0;
+    virtual void destroy() = 0;
+    virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& dirtyRect) = 0;
+    virtual void geometryDidChange(const WebCore::IntRect& frameRect) = 0;
+
+protected:
+    Plugin();
+};
+    
+} // namespace WebKit
+
+#endif // Plugin_h
index f97a640fbe69a3f75884fdd0bbc0b289dc305b79..8af22389f2be081f4989c0f1dc40c9247bba3d6d 100644 (file)
@@ -32,12 +32,14 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PluginView::PluginView()
+PluginView::PluginView(PassRefPtr<Plugin> plugin)
+    : m_plugin(plugin)
 {
 }
 
 PluginView::~PluginView()
 {
+    m_plugin->destroy();
 }
 
 void PluginView::setFrameRect(const WebCore::IntRect& rect)
@@ -55,19 +57,12 @@ void PluginView::paint(GraphicsContext* context, const IntRect& dirtyRect)
     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 
+    m_plugin->paint(context, paintRect);
 }
 
 void PluginView::viewGeometryDidChange()
 {
+    m_plugin->geometryDidChange(frameRect());
 }
 
 void PluginView::invalidateRect(const IntRect&)
index d00440ca8cbae2253d627f20df2f629997215e52..cac7f12e07e176d942ba36f3442a6377f0e1b23d 100644 (file)
@@ -36,13 +36,13 @@ class Plugin;
 
 class PluginView : public WebCore::Widget {
 public:
-    static PassRefPtr<PluginView> create()
+    static PassRefPtr<PluginView> create(PassRefPtr<Plugin> plugin)
     {
-        return adoptRef(new PluginView());
+        return adoptRef(new PluginView(plugin));
     }
 
 private:
-    PluginView();
+    PluginView(PassRefPtr<Plugin>);
     virtual ~PluginView();
 
     void viewGeometryDidChange();
@@ -51,6 +51,8 @@ private:
     virtual void setFrameRect(const WebCore::IntRect&);
     virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&);
     virtual void invalidateRect(const WebCore::IntRect&);
+    
+    RefPtr<Plugin> m_plugin;
 };
 
 } // namespace WebKit
index 4bcc0488ea4a9e6bb049b3576ffdc6c1a2323f86..0f094c44bb1aea667e4226cc987fc511170649ed 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "WebFrameLoaderClient.h"
 
+#include "DummyPlugin.h"
 #include "NotImplemented.h"
 #include "PluginView.h"
 #include "WebCoreArgumentCoders.h"
@@ -766,7 +767,10 @@ void WebFrameLoaderClient::didTransferChildFrameToNewDocument()
 PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually)
 {
     notImplemented();
-    return PluginView::create();
+    
+    RefPtr<DummyPlugin> plugin = DummyPlugin::create();
+
+    return PluginView::create(plugin.release());
 }
 
 void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
index c729b369003b5a7d0449fb5fcdbe69673ee2fc8a..a5e541263c87076548b96e259219d0ae173a7604 100755 (executable)
                        <Filter\r
                                Name="Plugins"\r
                                >\r
+                               <File\r
+                                       RelativePath="..\WebProcess\Plugins\DummyPlugin.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\WebProcess\Plugins\DummyPlugin.h"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\WebProcess\Plugins\Plugin.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\WebProcess\Plugins\Plugin.h"\r
+                                       >\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\WebProcess\Plugins\PluginView.cpp"\r
                                        >\r