WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Jun 2006 19:49:17 +0000 (19:49 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Jun 2006 19:49:17 +0000 (19:49 +0000)
2006-06-11  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Geoff.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9390
        Move full-frame plugins to WebCore

        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        Add PluginDocument

        * bridge/mac/FrameMac.h:
        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::redirectDataToPlugin):
        Call the bridge.

        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        Add redirectDataToPlugin which is used to redirect incoming data
        to a plugin.

        * bridge/mac/WebCoreViewFactory.h:
        Add pluginSupportsMIMEType which returns whether any plugins support a given MIME type.

        * dom/DOMImplementation.cpp:
        * dom/DOMImplementation.h:
        Get rid of createTextDocument and just create a text document explicitly when needed.

        * dom/Document.h:
        (WebCore::Document::isPluginDocument):
        * loader/PluginDocument.cpp: Added.
        (WebCore::PluginTokenizer::PluginTokenizer):
        (WebCore::PluginTokenizer::wantsRawData):
        (WebCore::PluginTokenizer::write):
        (WebCore::PluginTokenizer::createDocumentStructure):
        (WebCore::PluginTokenizer::writeRawData):
        (WebCore::PluginTokenizer::stopParsing):
        (WebCore::PluginTokenizer::finish):
        (WebCore::PluginTokenizer::isWaitingForScripts):
        (WebCore::PluginDocument::PluginDocument):
        (WebCore::PluginDocument::createTokenizer):
        * loader/PluginDocument.h: Added.
        (WebCore::PluginDocument::isPluginDocument):
        Add PluginDocument.

        * page/Frame.cpp:
        (WebCore::Frame::begin):
        Possibly create a plugin document.

        * page/Frame.h:
        (WebCore::Frame::redirectDataToPlugin):
        Add declaration.

        * platform/PlugInInfoStore.h:
        * platform/mac/PlugInInfoStoreMac.mm:
        (WebCore::PlugInInfoStore::supportsMIMEType):
        Ask WebCoreViewFactory if the MIME type is supported.

WebKit:

2006-06-11  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Tim.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9390
        Move full-frame plugins to WebCore

        * Plugins/WebBaseNetscapePluginStream.h:
        * Plugins/WebBaseNetscapePluginStream.m:
        (-[WebBaseNetscapePluginStream instance]):
        Add instance method which returns the plugin instance.

        * Plugins/WebBasePluginPackage.h:
        Add WebPluginManualLoader protocol

        * Plugins/WebNetscapePluginDocumentView.h: Removed.
        * Plugins/WebNetscapePluginDocumentView.m: Removed.

        * Plugins/WebNetscapePluginEmbeddedView.h:
        * Plugins/WebNetscapePluginEmbeddedView.m:
        (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:]):
        (-[WebNetscapePluginEmbeddedView dealloc]):
        (-[WebNetscapePluginEmbeddedView didStart]):
        (-[WebNetscapePluginEmbeddedView pluginView:receivedResponse:]):
        (-[WebNetscapePluginEmbeddedView pluginView:receivedData:]):
        (-[WebNetscapePluginEmbeddedView pluginView:receivedError:]):
        (-[WebNetscapePluginEmbeddedView pluginViewFinishedLoading:]):
        (-[WebNetscapePluginEmbeddedView redeliverStream]):
        Make WebNetscapePluginEmbeddedView support the WebPluginManualLoader protocol. It creates a plugin stream and feeds the
        data manually. Much of this code has been copied from WebNetscapePluginRepresentation.

        * Plugins/WebNetscapePluginRepresentation.h: Removed.
        * Plugins/WebNetscapePluginRepresentation.m: Removed.

        * Plugins/WebPluginController.h:
        * Plugins/WebPluginController.m:
        (-[WebPluginController pluginView:receivedResponse:]):
        (-[WebPluginController pluginView:receivedData:]):
        (-[WebPluginController pluginView:receivedError:]):
        (-[WebPluginController pluginViewFinishedLoading:]):
        Make WebPluginController support the WebPluginManualLoader protocol so it can feed data manually to WebKit plugins.

        * Plugins/WebPluginDatabase.m:
        (-[WebPluginDatabase refresh]):
        Use WebHTMLView and WebHTMLRepresentation when registering/unregistering plug-in MIME types.

        * Plugins/WebPluginDocumentView.h: Removed.
        * Plugins/WebPluginDocumentView.m: Removed.

        * WebCoreSupport/WebFrameBridge.m:
        (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:loadManually:]):
        (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]):
        Add loadManually argument.

        (-[WebFrameBridge redirectDataToPlugin:]):
        Call down to the HTML representation.

        (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]):
        Pass NO to loadManually.

        (-[WebFrameBridge determineObjectFromMIMEType:URL:]):
        Explicitly check if the MIME type is supported by a plug-in instead of checking the view class.

        * WebCoreSupport/WebViewFactory.m:
        (-[WebViewFactory pluginSupportsMIMEType:]):
        New function which returns whether any plugins support a given MIME type.

        * WebKit.xcodeproj/project.pbxproj:
        Update for removed files.

        * WebView/WebFrame.m:
        (-[WebFrame _reloadForPluginChanges]):
        Remove view type checks.

        (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]):
        (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]):
        Remove FIXME comments.

        * WebView/WebHTMLRepresentation.m:
        (-[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:]):
        New function which redirects incoming data to a manual loader.

        (-[WebHTMLRepresentation receivedData:withDataSource:]):
        (-[WebHTMLRepresentation receivedError:withDataSource:]):
        (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
        Optionally redirect incoming data.

        * WebView/WebHTMLRepresentationPrivate.h:

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

38 files changed:
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/bridge/mac/WebCoreViewFactory.h
WebCore/dom/DOMImplementation.cpp
WebCore/dom/DOMImplementation.h
WebCore/dom/Document.h
WebCore/loader/PluginDocument.cpp [new file with mode: 0644]
WebCore/loader/PluginDocument.h [new file with mode: 0644]
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/platform/PlugInInfoStore.h
WebCore/platform/mac/PlugInInfoStoreMac.mm
WebKit/ChangeLog
WebKit/Plugins/WebBaseNetscapePluginStream.h
WebKit/Plugins/WebBaseNetscapePluginStream.m
WebKit/Plugins/WebBasePluginPackage.h
WebKit/Plugins/WebNetscapePluginDocumentView.h [deleted file]
WebKit/Plugins/WebNetscapePluginDocumentView.m [deleted file]
WebKit/Plugins/WebNetscapePluginEmbeddedView.h
WebKit/Plugins/WebNetscapePluginEmbeddedView.m
WebKit/Plugins/WebNetscapePluginRepresentation.h [deleted file]
WebKit/Plugins/WebNetscapePluginRepresentation.m [deleted file]
WebKit/Plugins/WebPluginController.h
WebKit/Plugins/WebPluginController.m
WebKit/Plugins/WebPluginDatabase.m
WebKit/Plugins/WebPluginDocumentView.h [deleted file]
WebKit/Plugins/WebPluginDocumentView.m [deleted file]
WebKit/WebCoreSupport/WebFrameBridge.m
WebKit/WebCoreSupport/WebViewFactory.m
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.m
WebKit/WebView/WebHTMLRepresentation.m
WebKit/WebView/WebHTMLRepresentationPrivate.h

index 50db854068a6fcad795f77eedc945e63405e3e0f..e4d4f465dcf7973fd38c2a2f7f18fac61999cd90 100644 (file)
@@ -1,3 +1,61 @@
+2006-06-11  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Geoff.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9390
+        Move full-frame plugins to WebCore
+        
+        * WebCore.vcproj/WebCore/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        Add PluginDocument
+        
+        * bridge/mac/FrameMac.h:
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::redirectDataToPlugin):
+        Call the bridge.
+        
+        * bridge/mac/WebCoreFrameBridge.h:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        Add redirectDataToPlugin which is used to redirect incoming data
+        to a plugin.
+        
+        * bridge/mac/WebCoreViewFactory.h:
+        Add pluginSupportsMIMEType which returns whether any plugins support a given MIME type.
+        
+        * dom/DOMImplementation.cpp:
+        * dom/DOMImplementation.h:
+        Get rid of createTextDocument and just create a text document explicitly when needed.
+        
+        * dom/Document.h:
+        (WebCore::Document::isPluginDocument):
+        * loader/PluginDocument.cpp: Added.
+        (WebCore::PluginTokenizer::PluginTokenizer):
+        (WebCore::PluginTokenizer::wantsRawData):
+        (WebCore::PluginTokenizer::write):
+        (WebCore::PluginTokenizer::createDocumentStructure):
+        (WebCore::PluginTokenizer::writeRawData):
+        (WebCore::PluginTokenizer::stopParsing):
+        (WebCore::PluginTokenizer::finish):
+        (WebCore::PluginTokenizer::isWaitingForScripts):
+        (WebCore::PluginDocument::PluginDocument):
+        (WebCore::PluginDocument::createTokenizer):
+        * loader/PluginDocument.h: Added.
+        (WebCore::PluginDocument::isPluginDocument):
+        Add PluginDocument.
+        
+        * page/Frame.cpp:
+        (WebCore::Frame::begin):
+        Possibly create a plugin document.
+        
+        * page/Frame.h:
+        (WebCore::Frame::redirectDataToPlugin):
+        Add declaration.
+        
+        * platform/PlugInInfoStore.h:
+        * platform/mac/PlugInInfoStoreMac.mm:
+        (WebCore::PlugInInfoStore::supportsMIMEType):
+        Ask WebCoreViewFactory if the MIME type is supported.
+
 2006-06-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by hyatt.
index 9bc26c1f854588a6dd7a522ac6212d17bba55c9a..715e41c9330c0130157ace364068b3114097a041 100644 (file)
                                RelativePath="..\..\loader\loader.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\loader\PluginDocument.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\loader\PluginDocument.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\loader\Request.cpp"\r
                                >\r
index 3b3179adb6fa3908c92955e809d56ee82e54c19c..c4229830c148671b1426a91eeeb36c8a9f90a3a9 100644 (file)
                1A85B2B60A1B2AC700D8C87C /* JSHTMLDivElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A85B2B40A1B2AC700D8C87C /* JSHTMLDivElement.cpp */; };
                1A85B2B70A1B2AC700D8C87C /* JSHTMLDivElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A85B2B50A1B2AC700D8C87C /* JSHTMLDivElement.h */; };
                1A9EF4570A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */; };
+               1AC694C70A3B1676003F5049 /* PluginDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC694C50A3B1676003F5049 /* PluginDocument.cpp */; };
+               1AC694C80A3B1676003F5049 /* PluginDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC694C60A3B1676003F5049 /* PluginDocument.h */; };
                1AE2AA1E0A1CDAB400B42B25 /* JSHTMLAreaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE2AA0A0A1CDAB300B42B25 /* JSHTMLAreaElement.cpp */; };
                1AE2AA1F0A1CDAB400B42B25 /* JSHTMLAreaElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE2AA0B0A1CDAB300B42B25 /* JSHTMLAreaElement.h */; };
                1AE2AA200A1CDAB400B42B25 /* JSHTMLBaseFontElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE2AA0C0A1CDAB300B42B25 /* JSHTMLBaseFontElement.cpp */; };
                FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
 /* End PBXBuildFile section */
 
-/* Begin PBXBuildStyle section */
-               BCC0C2960A3792E6008CD7AD /* Development */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                       };
-                       name = Development;
-               };
-               BCC0C2970A3792E6008CD7AD /* Deployment */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                       };
-                       name = Deployment;
-               };
-/* End PBXBuildStyle section */
-
 /* Begin PBXContainerItemProxy section */
                DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                1A85B2B40A1B2AC700D8C87C /* JSHTMLDivElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLDivElement.cpp; sourceTree = "<group>"; };
                1A85B2B50A1B2AC700D8C87C /* JSHTMLDivElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLDivElement.h; sourceTree = "<group>"; };
                1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCanvasRenderingContext2DCustom.cpp; sourceTree = "<group>"; };
+               1AC694C50A3B1676003F5049 /* PluginDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PluginDocument.cpp; sourceTree = "<group>"; };
+               1AC694C60A3B1676003F5049 /* PluginDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginDocument.h; sourceTree = "<group>"; };
                1AE2A9F00A1CDA5700B42B25 /* HTMLAreaElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLAreaElement.idl; sourceTree = "<group>"; };
                1AE2A9F10A1CDA5700B42B25 /* HTMLBaseFontElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLBaseFontElement.idl; sourceTree = "<group>"; };
                1AE2A9F20A1CDA5700B42B25 /* HTMLBodyElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLBodyElement.idl; sourceTree = "<group>"; };
                                93ABCE5E06E1A42E0085925B /* FormData.h */,
                                1A820D8F0A13EBA600AF843C /* ImageDocument.cpp */,
                                1A820D900A13EBA600AF843C /* ImageDocument.h */,
+                               1AC694C50A3B1676003F5049 /* PluginDocument.cpp */,
+                               1AC694C60A3B1676003F5049 /* PluginDocument.h */,
                                BCB16C130979C3BD00467741 /* loader.cpp */,
                                BCB16C140979C3BD00467741 /* loader.h */,
                                BCB16C150979C3BD00467741 /* Request.cpp */,
                                4E19592A0A39DACC00220FE5 /* MediaQuery.h in Headers */,
                                4E19592C0A39DACC00220FE5 /* MediaQueryEvaluator.h in Headers */,
                                4E19592E0A39DACC00220FE5 /* MediaQueryExp.h in Headers */,
+                               1AC694C80A3B1676003F5049 /* PluginDocument.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       buildSettings = {
-                       };
-                       buildStyles = (
-                               BCC0C2960A3792E6008CD7AD /* Development */,
-                               BCC0C2970A3792E6008CD7AD /* Deployment */,
-                       );
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                                4E1959290A39DACC00220FE5 /* MediaQuery.cpp in Sources */,
                                4E19592B0A39DACC00220FE5 /* MediaQueryEvaluator.cpp in Sources */,
                                4E19592D0A39DACC00220FE5 /* MediaQueryExp.cpp in Sources */,
+                               1AC694C70A3B1676003F5049 /* PluginDocument.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index c476e55c869c7259d55403ee7068822ffbd69c34..9c524d6b5c2d614f4d46f01477a5f237303f6941 100644 (file)
@@ -136,6 +136,8 @@ public:
 
     virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
     virtual Plugin* createPlugin(Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType);
+    virtual void redirectDataToPlugin(Widget* pluginWidget);
+
     virtual Frame* createFrame(const KURL& url, const String& name, RenderPart* renderer, const String& referrer);
 
     virtual void scheduleClose();
index 79172267cc43a4287f074f5655808042b2f837e2..5fd098aa8a137ae9da8cbf2eae9ffb8d403b33c5 100644 (file)
@@ -524,12 +524,18 @@ Plugin* FrameMac::createPlugin(Element* element, const KURL& url, const Vector<S
                                   attributeNames:nsArray(paramNames)
                                   attributeValues:nsArray(paramValues)
                                   MIMEType:mimeType
-                                  DOMElement:(element ? [DOMElement _elementWith:element] : nil)]));
+                                  DOMElement:(element ? [DOMElement _elementWith:element] : nil)
+                                loadManually:d->m_doc->isPluginDocument()]));
 
     END_BLOCK_OBJC_EXCEPTIONS;
     return 0;
 }
 
+void FrameMac::redirectDataToPlugin(Widget* pluginWidget)
+{
+    [_bridge redirectDataToPlugin:pluginWidget->getView()];
+}
+
 
 Frame* FrameMac::createFrame(const KURL& url, const String& name, RenderPart* renderer, const String& referrer)
 {
index 9f320780c786346833b128bd1ae2883ac5b82d21..d8320a3a0f2e2f975a52f257362931546f983f57 100644 (file)
@@ -591,12 +591,14 @@ typedef enum {
                   attributeNames:(NSArray *)attributeNames
                  attributeValues:(NSArray *)attributeValues
                         MIMEType:(NSString *)MIMEType
-                      DOMElement:(DOMElement *)element;
+                      DOMElement:(DOMElement *)element
+                    loadManually:(BOOL)loadManually;
 - (NSView *)viewForJavaAppletWithFrame:(NSRect)frame
                         attributeNames:(NSArray *)attributeNames
                        attributeValues:(NSArray *)attributeValues
                                baseURL:(NSURL *)baseURL
                             DOMElement:(DOMElement *)element;
+- (void)redirectDataToPlugin:(NSView *)pluginView;
 
 - (BOOL)saveDocumentToPageCache:(id)documentInfo;
 
index 23798ca80d361f88bd40b3093fcf01b46717111b..0469a6aaaa079b94949794d8b47600e9aec3ae37 100644 (file)
@@ -52,6 +52,7 @@
 #import "ModifySelectionListLevel.h"
 #import "MoveSelectionCommand.h"
 #import "Page.h"
+#import "PlugInInfoStore.h"
 #import "RenderView.h"
 #import "RenderImage.h"
 #import "RenderPart.h"
@@ -2559,7 +2560,8 @@ static NSCharacterSet *_getPostSmartSet(void)
     String mimeType = m_frame->resourceRequest().m_responseMIMEType;
     
     if (WebCore::DOMImplementation::isTextMIMEType(mimeType) ||
-        Image::supportsType(mimeType))
+        Image::supportsType(mimeType) ||
+        PlugInInfoStore::supportsMIMEType(mimeType))
         return NO;
     
     return YES;
index 90ed121f4f42594b78123f73e697cbd4fd2a8feb..67cbc24127fc1210e1dfb0f182c66e6b47f0034f 100644 (file)
@@ -35,6 +35,7 @@
 
 - (NSArray *)pluginsInfo; // array of id <WebCorePluginInfo>
 - (void)refreshPlugins:(BOOL)reloadPages;
+- (BOOL)pluginSupportsMIMEType:(NSString *)MIMEType;
 
 - (NSString *)inputElementAltText;
 - (NSString *)resetButtonDefaultLabel;
index 17cfbd33c48a76b7f5caf4e57128b3f6d884e707..41cfe62a045ba2b41112e1ef338d432b95d6d9cb 100644 (file)
@@ -180,11 +180,6 @@ PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(FrameView* v)
     return new HTMLDocument(this, v);
 }
 
-PassRefPtr<TextDocument> DOMImplementation::createTextDocument(FrameView *v)
-{
-    return new TextDocument(this, v);
-}
-
 DOMImplementation* DOMImplementation::instance()
 {
     static RefPtr<DOMImplementation> i = new DOMImplementation;
index cca82e14ff572be33ca73493a1e41a783c5fefac..d645741fc8dfaea7375dccc8fb9b4aa7dc450371 100644 (file)
@@ -61,7 +61,6 @@ public:
     // Other methods (not part of DOM)
     PassRefPtr<Document> createDocument(FrameView* = 0);
     PassRefPtr<HTMLDocument> createHTMLDocument(FrameView* = 0);
-    PassRefPtr<TextDocument> createTextDocument(FrameView* v = 0);
 
     // Returns the static instance of this class - only one instance of this class should
     // ever be present, and is used as a factory method for creating Document objects
index e1ea7bbb9de56ef88a43f91c0bce7c23920ac3f5..949ec44a4e20a15c736eb16d440c3a31c54f3533 100644 (file)
@@ -213,7 +213,8 @@ public:
     // Other methods (not part of DOM)
     virtual bool isDocumentNode() const { return true; }
     virtual bool isHTMLDocument() const { return false; }
-
+    virtual bool isPluginDocument() const { return false; }
+    
     CSSStyleSelector* styleSelector() const { return m_styleSelector; }
 
     Element* getElementByAccessKey(const String& key) const;
diff --git a/WebCore/loader/PluginDocument.cpp b/WebCore/loader/PluginDocument.cpp
new file mode 100644 (file)
index 0000000..68c4905
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * 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 "config.h"
+
+#include "PluginDocument.h"
+
+#include "Frame.h"
+#include "Element.h"
+#include "HTMLNames.h"
+#include "RenderWidget.h"
+#include "SegmentedString.h"
+#include "Text.h"
+#include "HTMLEmbedElement.h"
+#include "xml_tokenizer.h"
+
+namespace WebCore {
+    
+using namespace HTMLNames;
+    
+class PluginTokenizer : public Tokenizer {
+public:
+    PluginTokenizer(Document* doc) : m_doc(doc), m_embedElement(0) {}
+        
+    virtual bool write(const SegmentedString&, bool appendData);
+    virtual void stopParsing();
+    virtual void finish();
+    virtual bool isWaitingForScripts() const;
+        
+    virtual bool wantsRawData() const { return true; }
+    virtual bool writeRawData(const char* data, int len);
+        
+    void createDocumentStructure();
+private:
+    Document* m_doc;
+    HTMLEmbedElement* m_embedElement;
+};
+    
+bool PluginTokenizer::write(const SegmentedString& s, bool appendData)
+{
+    ASSERT_NOT_REACHED();
+    return false;
+}
+    
+void PluginTokenizer::createDocumentStructure()
+{
+    ExceptionCode ec;
+    RefPtr<Element> rootElement = m_doc->createElementNS(xhtmlNamespaceURI, "html", ec);
+    m_doc->appendChild(rootElement, ec);
+        
+    RefPtr<Element> body = m_doc->createElementNS(xhtmlNamespaceURI, "body", ec);
+    body->setAttribute(marginwidthAttr, "0");
+    body->setAttribute(marginheightAttr, "0");
+       
+    rootElement->appendChild(body, ec);
+        
+    RefPtr<Element> embedElement = m_doc->createElementNS(xhtmlNamespaceURI, "embed", ec);
+        
+    m_embedElement = static_cast<HTMLEmbedElement*>(embedElement.get());
+    m_embedElement->setAttribute(widthAttr, "100%");
+    m_embedElement->setAttribute(heightAttr, "100%");
+    
+    m_embedElement->setAttribute(nameAttr, "plugin");
+    m_embedElement->setSrc(m_doc->URL());
+    m_embedElement->setType(m_doc->frame()->resourceRequest().m_responseMIMEType);
+    
+    body->appendChild(embedElement, ec);    
+}
+    
+bool PluginTokenizer::writeRawData(const char* data, int len)
+{
+    if (!m_embedElement) {
+        createDocumentStructure();
+        m_doc->frame()->redirectDataToPlugin(static_cast<RenderWidget*>(m_embedElement->renderer())->widget());
+        return false;
+    }
+    
+    ASSERT_NOT_REACHED();
+    
+    return false;
+}
+    
+void PluginTokenizer::stopParsing()
+{
+    Tokenizer::stopParsing();        
+}
+    
+void PluginTokenizer::finish()
+{
+    if (!m_parserStopped) 
+        m_doc->finishedParsing();            
+}
+    
+bool PluginTokenizer::isWaitingForScripts() const
+{
+    // A plugin document is never waiting for scripts
+    return false;
+}
+    
+PluginDocument::PluginDocument(DOMImplementation* _implementation, FrameView* v)
+    : HTMLDocument(_implementation, v)
+{
+    setParseMode(Compat);
+}
+    
+Tokenizer* PluginDocument::createTokenizer()
+{
+    return new PluginTokenizer(this);
+}
+    
+}
diff --git a/WebCore/loader/PluginDocument.h b/WebCore/loader/PluginDocument.h
new file mode 100644 (file)
index 0000000..9084c32
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * 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 PluginDocument_h
+#define PluginDocument_h
+
+#include "HTMLDocument.h"
+
+namespace WebCore {
+    
+class DOMImplementation;
+class FrameView;
+    
+class PluginDocument : public HTMLDocument
+{
+public:
+    PluginDocument(DOMImplementation*, FrameView* = 0);
+
+    virtual bool isPluginDocument() const { return true; }
+        
+    virtual Tokenizer* createTokenizer();
+};
+    
+}
+
+#endif // ImageDocument_h
index 381a7ede58bf134a3d2d744b3513966bd2536295..ef3173224c690cfe70e32f6a058ab7161ff5950b 100644 (file)
@@ -57,6 +57,8 @@
 #include "NodeList.h"
 #include "Page.h"
 #include "Plugin.h"
+#include "PluginDocument.h"
+#include "PlugInInfoStore.h"
 #include "RenderPart.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
@@ -614,8 +616,10 @@ void Frame::begin(const KURL& url)
     d->m_doc = DOMImplementation::instance()->createDocument(d->m_view.get());
   else if (DOMImplementation::isTextMIMEType(d->m_request.m_responseMIMEType))
     d->m_doc = new TextDocument(DOMImplementation::instance(), d->m_view.get());
- else if (Image::supportsType(d->m_request.m_responseMIMEType))
 else if (Image::supportsType(d->m_request.m_responseMIMEType))
     d->m_doc = new ImageDocument(DOMImplementation::instance(), d->m_view.get());
+  else if (PlugInInfoStore::supportsMIMEType(d->m_request.m_responseMIMEType))
+    d->m_doc = new PluginDocument(DOMImplementation::instance(), d->m_view.get());
   else
     d->m_doc = DOMImplementation::instance()->createHTMLDocument(d->m_view.get());
 
index acac61b59e5f87f42d8a0d3672421cca4f0aa461..94a6caf2587ec68e5af1be64e31b140c83c6c5dc 100644 (file)
@@ -568,12 +568,13 @@ public:
   virtual bool passWheelEventToChildWidget(Node*) = 0;
   virtual bool lastEventIsMouseUp() const = 0;
   virtual String overrideMediaType() const = 0;
+  virtual void redirectDataToPlugin(Widget* pluginWidget) { }
 protected:
   virtual Plugin* createPlugin(Element* node, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType) = 0;
   virtual Frame* createFrame(const KURL& url, const String& name, RenderPart* renderer, const String& referrer) = 0;
   virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType) = 0;
 
-    virtual void redirectionTimerFired(Timer<Frame>*);
+  virtual void redirectionTimerFired(Timer<Frame>*);
 
 public:
   void loadDone();
index 6a36953158261137d858bbc07239ce458e2643f0..70ea4a0020e84687c9797aacca55b311026598e3 100644 (file)
@@ -50,7 +50,8 @@ struct PluginInfo {
 class PlugInInfoStore {
 public:
     PluginInfo *createPluginInfoForPluginAtIndex(unsigned);
-    unsigned pluginCount() const;    
+    unsigned pluginCount() const;
+    static bool supportsMIMEType(const String& mimeType);
 };
 
 void refreshPlugins(bool reloadOpenPages);
index 19dc525ed2ca698da57516470a3b66273a6bd1b9..e019778104d66d3e2e9f24347c221bfea9df6b7b 100644 (file)
@@ -74,6 +74,15 @@ unsigned PlugInInfoStore::pluginCount() const
     return 0;
 }
 
+bool PlugInInfoStore::supportsMIMEType(const String& mimeType)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    return [[WebCoreViewFactory sharedFactory] pluginSupportsMIMEType:mimeType];
+    END_BLOCK_OBJC_EXCEPTIONS;    
+    
+    return NO;
+}
+
 void refreshPlugins(bool reloadOpenPages)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
index 0ed8d2898dac02232f40731183ba5c3126445dff..0b02295cc3dfc7cc7328f2cbb9a32052a191fd02 100644 (file)
@@ -1,3 +1,92 @@
+2006-06-11  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Tim.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9390
+        Move full-frame plugins to WebCore
+
+        * Plugins/WebBaseNetscapePluginStream.h:
+        * Plugins/WebBaseNetscapePluginStream.m:
+        (-[WebBaseNetscapePluginStream instance]):
+        Add instance method which returns the plugin instance.
+        
+        * Plugins/WebBasePluginPackage.h:
+        Add WebPluginManualLoader protocol
+        
+        * Plugins/WebNetscapePluginDocumentView.h: Removed.
+        * Plugins/WebNetscapePluginDocumentView.m: Removed.
+
+        * Plugins/WebNetscapePluginEmbeddedView.h:
+        * Plugins/WebNetscapePluginEmbeddedView.m:
+        (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:]):
+        (-[WebNetscapePluginEmbeddedView dealloc]):
+        (-[WebNetscapePluginEmbeddedView didStart]):
+        (-[WebNetscapePluginEmbeddedView pluginView:receivedResponse:]):
+        (-[WebNetscapePluginEmbeddedView pluginView:receivedData:]):
+        (-[WebNetscapePluginEmbeddedView pluginView:receivedError:]):
+        (-[WebNetscapePluginEmbeddedView pluginViewFinishedLoading:]):
+        (-[WebNetscapePluginEmbeddedView redeliverStream]):
+        Make WebNetscapePluginEmbeddedView support the WebPluginManualLoader protocol. It creates a plugin stream and feeds the
+        data manually. Much of this code has been copied from WebNetscapePluginRepresentation.
+
+        * Plugins/WebNetscapePluginRepresentation.h: Removed.
+        * Plugins/WebNetscapePluginRepresentation.m: Removed.
+
+        * Plugins/WebPluginController.h:
+        * Plugins/WebPluginController.m:
+        (-[WebPluginController pluginView:receivedResponse:]):
+        (-[WebPluginController pluginView:receivedData:]):
+        (-[WebPluginController pluginView:receivedError:]):
+        (-[WebPluginController pluginViewFinishedLoading:]):
+        Make WebPluginController support the WebPluginManualLoader protocol so it can feed data manually to WebKit plugins.
+
+        * Plugins/WebPluginDatabase.m:        
+        (-[WebPluginDatabase refresh]):
+        Use WebHTMLView and WebHTMLRepresentation when registering/unregistering plug-in MIME types.
+        
+        * Plugins/WebPluginDocumentView.h: Removed.
+        * Plugins/WebPluginDocumentView.m: Removed.
+
+        * WebCoreSupport/WebFrameBridge.m:
+        (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:loadManually:]):
+        (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]):
+        Add loadManually argument.
+        
+        (-[WebFrameBridge redirectDataToPlugin:]):
+        Call down to the HTML representation.
+        
+        (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]):
+        Pass NO to loadManually.
+        
+        (-[WebFrameBridge determineObjectFromMIMEType:URL:]):
+        Explicitly check if the MIME type is supported by a plug-in instead of checking the view class.
+        
+        * WebCoreSupport/WebViewFactory.m:
+        (-[WebViewFactory pluginSupportsMIMEType:]):
+        New function which returns whether any plugins support a given MIME type.
+        
+        * WebKit.xcodeproj/project.pbxproj:
+        Update for removed files.
+        
+        * WebView/WebFrame.m:
+        (-[WebFrame _reloadForPluginChanges]):
+        Remove view type checks.
+        
+        (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]):
+        (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]):
+        Remove FIXME comments.
+        
+        * WebView/WebHTMLRepresentation.m:
+        (-[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:]):        
+        New function which redirects incoming data to a manual loader.
+        
+        (-[WebHTMLRepresentation receivedData:withDataSource:]):
+        (-[WebHTMLRepresentation receivedError:withDataSource:]):
+        (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
+        Optionally redirect incoming data.
+        
+        * WebView/WebHTMLRepresentationPrivate.h:
+
 2006-06-09  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Tim Omernick and Dave Hyatt.
index 3739eacb502bd56a65bd2b66ce2e9db685a10468..6b767ff0ec7973f5a37f7d6fdf151c7427b244e8 100644 (file)
@@ -72,6 +72,7 @@
 - (void)setPluginPointer:(NPP)pluginPointer;
 
 - (uint16)transferMode;
+- (NPP)instance;
 
 - (void)startStreamResponseURL:(NSURL *)theResponseURL
          expectedContentLength:(long long)expectedContentLength
index f5a66ad3b760f60f36819e8a78bd09f99536deac..9e3fb60aa1ded12d92a4c2a2072677288c92ca76 100644 (file)
@@ -142,6 +142,11 @@ static char *CarbonPathFromPOSIXPath(const char *posixPath);
     return transferMode;
 }
 
+- (NPP)instance
+{
+    return instance;
+}
+
 - (void)setRequestURL:(NSURL *)theRequestURL
 {
     [theRequestURL retain];
index 4289b791d838f819660f6e6f8c93681d8166f02a..fcaa90d106562b48f3c152a13c20a0ca87c4234e 100644 (file)
 #import <WebCore/WebCoreViewFactory.h>
 #import <WebKit/npfunctions.h>
 
+@protocol WebPluginManualLoader
+- (void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response;
+- (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data;
+- (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error;
+- (void)pluginViewFinishedLoading:(NSView *)pluginView;
+@end
+
 #define WebPluginExtensionsKey          @"WebPluginExtensions"
 #define WebPluginDescriptionKey         @"WebPluginDescription"
 #define WebPluginLocalizationNameKey    @"WebPluginLocalizationName"
diff --git a/WebKit/Plugins/WebNetscapePluginDocumentView.h b/WebKit/Plugins/WebNetscapePluginDocumentView.h
deleted file mode 100644 (file)
index 757ef7c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
- */
-
-#import <AppKit/AppKit.h>
-
-#import <WebKit/WebBaseNetscapePluginView.h>
-
-@protocol WebDocumentView;
-
-@interface WebNetscapePluginDocumentView : WebBaseNetscapePluginView   <WebDocumentView>
-{
-    WebDataSource *dataSource;
-
-    BOOL needsLayout;
-}
-
-@end
diff --git a/WebKit/Plugins/WebNetscapePluginDocumentView.m b/WebKit/Plugins/WebNetscapePluginDocumentView.m
deleted file mode 100644 (file)
index ed78a6f..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
- */
-
-#import <WebKit/WebDataSource.h>
-#import <WebKit/WebDocument.h>
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebFrameView.h>
-#import <WebKit/WebKitErrorsPrivate.h>
-#import <WebKit/WebNetscapePluginDocumentView.h>
-#import <WebKit/WebNetscapePluginRepresentation.h>
-#import <WebKit/WebNSViewExtras.h>
-#import <WebKit/WebNetscapePluginPackage.h>
-#import <WebKit/WebPluginDatabase.h>
-#import <WebKit/WebResourceLoadDelegate.h>
-#import <WebKit/WebViewInternal.h>
-
-#import <JavaScriptCore/Assertions.h>
-#import <Foundation/NSURLResponse.h>
-
-@implementation WebNetscapePluginDocumentView
-
-- initWithFrame:(NSRect)frame
-{
-    [super initWithFrame:frame];
-    [self setFrame:NSZeroRect];
-    [self setMode:NP_FULL];
-    [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    needsLayout = YES;
-    return self;
-}
-
-- (void)dealloc
-{
-    [dataSource release];
-    [super dealloc];
-}
-
-- (void)drawRect:(NSRect)rect
-{
-    if(needsLayout){
-        [self layout];
-    }
-
-    [super drawRect:rect];
-}
-
-- (BOOL)canStart
-{
-    return (dataSource != nil);
-}
-
-- (void)didStart
-{
-    // Deliver what has not been passed to the plug-in up to this point.
-    // Do this in case the plug-in was started after the load started.
-    WebNetscapePluginRepresentation *representation = (WebNetscapePluginRepresentation *)[dataSource representation];
-    ASSERT([representation isKindOfClass:[WebNetscapePluginRepresentation class]]);
-    [representation redeliverStream];
-}
-
-- (WebDataSource *)dataSource
-{
-    return dataSource;
-}
-
-- (void)setDataSource:(WebDataSource *)theDataSource
-{    
-    [dataSource release];
-    dataSource = [theDataSource retain];
-
-    NSString *MIME = [[dataSource response] MIMEType];
-    
-    [self setMIMEType:MIME];
-    [self setBaseURL:[[dataSource request] URL]];
-
-    WebNetscapePluginPackage *thePlugin;
-    thePlugin = (WebNetscapePluginPackage *)[[WebPluginDatabase installedPlugins] pluginForMIMEType:MIME];
-    ASSERT([thePlugin isKindOfClass:[WebNetscapePluginPackage class]]);
-
-    if (![thePlugin load]) {
-        NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorCannotLoadPlugIn
-                                                        contentURL:[[theDataSource request] URL]
-                                                     pluginPageURL:nil
-                                                        pluginName:[thePlugin name]
-                                                          MIMEType:MIME];
-        WebView *webView = [[theDataSource webFrame] webView];
-        [[webView _resourceLoadDelegateForwarder] webView:webView
-                                    plugInFailedWithError:error
-                                               dataSource:theDataSource];
-        [error release];
-        return;
-    }
-
-    [self setPlugin:thePlugin];
-
-    if ([self currentWindow]) {
-        [self start];
-    }
-}
-
-- (void)dataSourceUpdated:(WebDataSource *)dataSource
-{
-    if (needsLayout)
-        [self layout];
-}
-
-- (void)setNeedsLayout:(BOOL)flag
-{
-    needsLayout = flag;
-}
-
-- (void)layout
-{
-    NSRect superFrame = [[[dataSource webFrame] frameView] frame];
-    [self setFrame:NSMakeRect(0, 0, NSWidth(superFrame), NSHeight(superFrame))];
-    needsLayout = NO;
-}
-
-- (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow
-{
-    [super viewWillMoveToHostWindow:hostWindow];
-}
-
-- (void)viewDidMoveToHostWindow
-{
-    [super viewDidMoveToHostWindow];
-}
-
-- (BOOL)documentViewShouldHandlePrint
-{
-    // Allow the plugin to take over printing if it defines an NPP_Print function
-    return (NPP_Print != NULL);
-}
-
-- (void)printDocumentView
-{
-    // The plugin cannot print if it does not have an NPP_Print function
-    if (!NPP_Print)
-        return;
-    
-    // Let the plugin take control of printing when in NP_FULL mode
-    NPPrint platformPrint;
-    platformPrint.mode = NP_FULL;
-    platformPrint.print.fullPrint.pluginPrinted = 0;
-    platformPrint.print.fullPrint.printOne = 0;
-    platformPrint.print.fullPrint.platformPrint = NULL;
-    NPP_Print(instance, &platformPrint);
-}
-
-@end
index 43122d279673e3e6d28271a40088e45a872b70c4..d2ce5b16011131078b0a657c6a586cff9e1e49a8 100644 (file)
 #import <AppKit/AppKit.h>
 
 #import <WebKit/WebBaseNetscapePluginView.h>
+#import <WebKit/WebBasePluginPackage.h>
 
 @class WebFrame;
+@class WebNetscapePluginStream;
 
-@interface WebNetscapePluginEmbeddedView : WebBaseNetscapePluginView
+@interface WebNetscapePluginEmbeddedView : WebBaseNetscapePluginView <WebPluginManualLoader>
 {
     NSURL *URL;
     WebFrame *_webFrame;
+    
+    BOOL _loadManually;
+    WebNetscapePluginStream *_manualStream;
+    unsigned _dataLengthReceived;
+    NSError *_error;
 }
 
 - (id)initWithFrame:(NSRect)r
             baseURL:(NSURL *)baseURL
            MIMEType:(NSString *)MIME
       attributeKeys:(NSArray *)keys
-    attributeValues:(NSArray *)values;
+    attributeValues:(NSArray *)values
+       loadManually:(BOOL)loadManually;
 
 - (void)setWebFrame:(WebFrame *)webFrame;
 
+- (void)redeliverStream;
+
 @end
index 226da8fc54df6fce2893631e3029b2968fffd100..432fe4d590abd949bc295ce0cc1f12aca93728ce 100644 (file)
@@ -28,6 +28,8 @@
 
 #import <WebKit/WebNetscapePluginEmbeddedView.h>
 
+#import <JavaScriptCore/Assertions.h>
+
 #import <WebKit/WebBaseNetscapePluginViewPrivate.h>
 #import <WebKit/WebFrameBridge.h>
 #import <WebKit/WebDataSource.h>
@@ -35,6 +37,7 @@
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebNetscapePluginPackage.h>
+#import <WebKit/WebNetscapePluginStream.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebNSURLExtras.h>
 #import <WebKit/WebNSURLRequestExtras.h>
@@ -49,6 +52,7 @@
            MIMEType:(NSString *)MIME
       attributeKeys:(NSArray *)keys
     attributeValues:(NSArray *)values
+       loadManually:(BOOL)loadManually
 {
     [super initWithFrame:frame];
 
     [self setMIMEType:MIME];
     [self setBaseURL:theBaseURL];
     [self setAttributeKeys:keys andValues:values];
-    [self setMode:NP_EMBED];
+    if (loadManually)
+        [self setMode:NP_FULL];
+    else
+        [self setMode:NP_EMBED];
 
+    _loadManually = loadManually;
+    
     return self;
 }
 
 - (void)dealloc
 {
     [URL release];
+    [_manualStream release];
+    [_error release];
     [super dealloc];
 }
 
 - (void)didStart
 {
+    if (_loadManually) {
+        [self redeliverStream];
+        return;
+    }
+    
     // If the OBJECT/EMBED tag has no SRC, the URL is passed to us as "".
     // Check for this and don't start a load in this case.
     if (URL != nil && ![URL _web_isEmpty]) {
         NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
         [request _web_setHTTPReferrer:[[[self webFrame] _bridge] referrer]];
         [self loadRequest:request inTarget:nil withNotifyData:nil sendNotification:NO];
-    }
+    } 
 }
 
 - (void)setWebFrame:(WebFrame *)webFrame
     return [_webFrame dataSource];
 }
 
+-(void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response
+{
+    ASSERT(_loadManually);
+    ASSERT(!_manualStream);
+    
+    _manualStream = [[WebNetscapePluginStream alloc] init];
+}
+
+- (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data
+{
+    ASSERT(_loadManually);
+    ASSERT(_manualStream);
+    
+    _dataLengthReceived += [data length];
+    
+    if (![self isStarted])
+        return;
+    
+    if ([_manualStream instance] == NULL) {
+        [_manualStream setRequestURL:[[[self dataSource] request] URL]];
+        [_manualStream setPluginPointer:[self pluginPointer]];
+        ASSERT([_manualStream instance]);
+        [_manualStream startStreamWithResponse:[[self dataSource] response]];
+    }
+    
+    if ([_manualStream instance])
+        [_manualStream receivedData:data];
+}
+
+- (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error
+{
+    ASSERT(_loadManually);
+    
+    [error retain];
+    [_error release];
+    _error = error;
+    
+    if (![self isStarted]) {
+        return;
+    }
+    
+    [_manualStream destroyStreamWithError:error];
+}
+
+- (void)pluginViewFinishedLoading:(NSView *)pluginView 
+{
+    ASSERT(_loadManually);
+    ASSERT(_manualStream);
+    
+    if ([self isStarted])
+        [_manualStream finishedLoadingWithData:[[self dataSource] data]];    
+}
+
+- (void)redeliverStream
+{
+    if ([self dataSource] && [self isStarted]) {
+        // Deliver what has not been passed to the plug-in up to this point.
+        if (_dataLengthReceived > 0) {
+            NSData *data = [[[self dataSource] data] subdataWithRange:NSMakeRange(0, _dataLengthReceived)];
+            instance = NULL;
+            _dataLengthReceived = 0;
+            [self pluginView:self receivedData:data];
+            if (![[self dataSource] isLoading]) {
+                if (_error)
+                    [self pluginView:self receivedError:_error];
+                else
+                    [self pluginViewFinishedLoading:self];
+            }
+        }
+    }
+}
+
 @end
diff --git a/WebKit/Plugins/WebNetscapePluginRepresentation.h b/WebKit/Plugins/WebNetscapePluginRepresentation.h
deleted file mode 100644 (file)
index 20657b3..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
- */
-
-#import <Foundation/Foundation.h>
-
-#import <WebKit/WebBaseNetscapePluginStream.h>
-
-@class NSError;
-@class WebDataSource;
-@protocol WebDocumentRepresentation;
-
-@interface WebNetscapePluginRepresentation : WebBaseNetscapePluginStream <WebDocumentRepresentation>
-{
-    unsigned _dataLengthReceived;
-    WebDataSource *_dataSource;
-    NSError *_error;
-}
-
-- (void)redeliverStream;
-
-@end
diff --git a/WebKit/Plugins/WebNetscapePluginRepresentation.m b/WebKit/Plugins/WebNetscapePluginRepresentation.m
deleted file mode 100644 (file)
index 72fe30c..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
- */
-
-#import <WebKit/WebNetscapePluginRepresentation.h>
-
-#import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebFrameView.h>
-#import <WebKit/WebNetscapePluginDocumentView.h>
-#import <WebKit/WebNetscapePluginPackage.h>
-
-#import <Foundation/NSURLResponse.h>
-
-@implementation WebNetscapePluginRepresentation
-
-- (void)dealloc
-{
-    [_error release];
-    [super dealloc];
-}
-
-- (void)setDataSource:(WebDataSource *)ds
-{
-    _dataSource = ds;
-}
-
-- (BOOL)isPluginViewStarted
-{
-    WebNetscapePluginDocumentView *view = (WebNetscapePluginDocumentView *)[[[_dataSource webFrame] frameView] documentView];
-    ASSERT([view isKindOfClass:[WebNetscapePluginDocumentView class]]);
-    return [view isStarted];
-}
-
-- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)ds
-{
-    _dataLengthReceived += [data length];
-    
-    WebNetscapePluginDocumentView *view = (WebNetscapePluginDocumentView *)[[[_dataSource webFrame] frameView] documentView];
-    ASSERT([view isKindOfClass:[WebNetscapePluginDocumentView class]]);
-    
-    if (![view isStarted]) {
-        return;
-    }
-    
-    if (instance == NULL) {
-        [self setRequestURL:[[_dataSource request] URL]];
-        [self setPluginPointer:[view pluginPointer]];
-        ASSERT(instance);
-        [self startStreamWithResponse:[ds response]];
-    }
-    
-    // Do not add data if there is no NPP instance.  The instance is cleared when the stream is destroyed.
-    if (instance)
-        [self receivedData:data];
-}
-
-- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)ds
-{
-    [error retain];
-    [_error release];
-    _error = error;
-    
-    if (![self isPluginViewStarted]) {
-        return;
-    }
-    
-    [self destroyStreamWithError:error];
-}
-
-- (void)cancelLoadWithError:(NSError *)error
-{
-    [_dataSource _stopLoadingWithError:error];
-}
-
-- (void)finishedLoadingWithDataSource:(WebDataSource *)ds
-{    
-    if ([self isPluginViewStarted]) {
-        [self finishedLoadingWithData:[ds data]];
-    }
-}
-
-- (BOOL)canProvideDocumentSource
-{
-    return NO;
-}
-
-- (NSString *)documentSource
-{
-    return nil;
-}
-
-- (NSString *)title
-{
-    return nil;
-}
-
-- (void)redeliverStream
-{
-    if (_dataSource && [self isPluginViewStarted]) {
-        // Deliver what has not been passed to the plug-in up to this point.
-        if (_dataLengthReceived > 0) {
-            NSData *data = [[_dataSource data] subdataWithRange:NSMakeRange(0, _dataLengthReceived)];
-            instance = NULL;
-            _dataLengthReceived = 0;
-            [self receivedData:data withDataSource:_dataSource];
-            if (![_dataSource isLoading]) {
-                if (_error)
-                    [self receivedError:_error withDataSource:_dataSource];
-                else
-                    [self finishedLoadingWithDataSource:_dataSource];
-            }
-        }
-    }
-}
-
-@end
index 0661946b2e7d83ee88050f6288e3ce598a7f52c1..4f25326bd1c289ecee286edc279760d4749e16b3 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #import <Foundation/Foundation.h>
+#import <WebKit/WebBasePluginPackage.h>
 
 @class WebHTMLView;
 @class WebPluginPackage;
@@ -34,7 +35,7 @@
 @class WebView;
 @class WebDataSource;
 
-@interface WebPluginController : NSObject
+@interface WebPluginController : NSObject <WebPluginManualLoader>
 {
     NSView *_documentView;
     WebDataSource *_dataSource;
index f750c29ee67973aaf67426efbc59b79bebe5d118..78142e756a3900644feaa25ad83b69421faa1363 100644 (file)
@@ -33,6 +33,7 @@
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebHTMLViewPrivate.h>
+#import <WebKit/WebKitErrorsPrivate.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebNSURLExtras.h>
 #import <WebKit/WebNSViewExtras.h>
@@ -40,6 +41,7 @@
 #import <WebKit/WebPluginContainer.h>
 #import <WebKit/WebPluginContainerCheck.h>
 #import <WebKit/WebPluginPackage.h>
+#import <WebKit/WebPluginPrivate.h>
 #import <WebKit/WebPluginViewFactory.h>
 #import <WebKit/WebViewInternal.h>
 #import <WebKit/WebUIDelegate.h>
@@ -355,4 +357,40 @@ static NSMutableSet *pluginViews = nil;
     return [responseURL _web_originalDataAsString];
 }
 
+- (void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response
+{    
+    if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidReceiveResponse:)])
+        [pluginView webPlugInMainResourceDidReceiveResponse:response];
+    else {
+        // Cancel the load since this plug-in does its own loading.
+
+        // FIXME: See <rdar://problem/4258008>
+        NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInWillHandleLoad
+                                                        contentURL:[response URL]
+                                                     pluginPageURL:nil
+                                                        pluginName:nil // FIXME: Get this from somewhere
+                                                          MIMEType:[response MIMEType]];
+        [_dataSource _stopLoadingWithError:error];
+        [error release];
+    }        
+}
+
+- (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data
+{
+    if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidReceiveData:)])
+        [pluginView webPlugInMainResourceDidReceiveData:data];
+}
+
+- (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error
+{
+    if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidFailWithError:)])
+        [pluginView webPlugInMainResourceDidFailWithError:error];
+}
+
+- (void)pluginViewFinishedLoading:(NSView *)pluginView
+{
+    if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidFinishLoading)])
+        [pluginView webPlugInMainResourceDidFinishLoading];
+}
+
 @end
index 01707ce68432460b03928924a38a2c21cb7feab8..c912db6ede34df7e9a516bf194cc407683158a91 100644 (file)
 #import <WebKit/WebDataSourcePrivate.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFrameViewInternal.h>
+#import <WebKit/WebHTMLRepresentation.h>
+#import <WebKit/WebHTMLView.h>
 #import <WebKit/WebKitLogging.h>
-#import <WebKit/WebNetscapePluginDocumentView.h>
 #import <WebKit/WebNetscapePluginPackage.h>
-#import <WebKit/WebNetscapePluginRepresentation.h>
-#import <WebKit/WebPluginDocumentView.h>
 #import <WebKit/WebPluginPackage.h>
 #import <WebKit/WebViewPrivate.h>
 #import <WebKitSystemInterface.h>
@@ -188,6 +187,20 @@ static NSArray *pluginLocations(void)
     
     //  Remove all uninstalled plug-ins and add the new plug-ins.
     if (plugins) {
+        // Unregister plug-in views and representations
+        NSMutableDictionary *MIMEToViewClass = [WebFrameView _viewTypesAllowImageTypeOmission:NO];        
+        NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
+        WebBasePluginPackage *pluginPackage;
+        while ((pluginPackage = [pluginEnumerator nextObject])) {
+            NSEnumerator *MIMETypeEnumerator = [pluginPackage MIMETypeEnumerator];
+            NSString *MIMEType;
+            while ((MIMEType = [MIMETypeEnumerator nextObject])) {
+                Class class = [MIMEToViewClass objectForKey:MIMEType];
+                if (class == [WebHTMLView class])
+                    [WebView _unregisterViewClassAndRepresentationClassForMIMEType:MIMEType];
+            }
+        }
+        
         NSMutableSet *pluginsToUnload = [plugins mutableCopy];
         [pluginsToUnload minusSet:newPlugins];
 #if !LOG_DISABLED
@@ -211,16 +224,6 @@ static NSArray *pluginLocations(void)
         plugins = newPlugins;
     }
     
-    // Unregister netscape plug-in WebDocumentViews and WebDocumentRepresentations.
-    NSMutableDictionary *MIMEToViewClass = [WebFrameView _viewTypesAllowImageTypeOmission:NO];
-    NSEnumerator *keyEnumerator = [MIMEToViewClass keyEnumerator];
-    NSString *MIMEType;
-    while ((MIMEType = [keyEnumerator nextObject]) != nil) {
-        Class class = [MIMEToViewClass objectForKey:MIMEType];
-        if (class == [WebNetscapePluginDocumentView class] || class == [WebPluginDocumentView class])
-            [WebView _unregisterViewClassAndRepresentationClassForMIMEType:MIMEType];
-    }
-    
     // Build a list of MIME types.
     NSMutableSet *MIMETypes = [[NSMutableSet alloc] init];
     NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
@@ -229,9 +232,10 @@ static NSArray *pluginLocations(void)
         [MIMETypes addObjectsFromArray:[[plugin MIMETypeEnumerator] allObjects]];
     }
     
-    // Register plug-in WebDocumentViews and WebDocumentRepresentations.
+    // Register plug-in views and representations.
     NSEnumerator *MIMEEnumerator = [[MIMETypes allObjects] objectEnumerator];
     [MIMETypes release];
+    NSString *MIMEType;
     while ((MIMEType = [MIMEEnumerator nextObject]) != nil) {
         if ([WebView canShowMIMETypeAsHTML:MIMEType])
             // Don't allow plug-ins to override our core HTML types.
@@ -243,13 +247,8 @@ static NSArray *pluginLocations(void)
         if ([plugin isQuickTimePlugIn] && [[WebFrameView _viewTypesAllowImageTypeOmission:NO] objectForKey:MIMEType])
             // Don't allow the QT plug-in to override any types because it claims many that we can handle ourselves.
             continue;
-        if ([plugin isKindOfClass:[WebNetscapePluginPackage class]])
-            [WebView registerViewClass:[WebNetscapePluginDocumentView class] representationClass:[WebNetscapePluginRepresentation class] forMIMEType:MIMEType];
-        else {
-            ASSERT([plugin isKindOfClass:[WebPluginPackage class]]);
-            [WebView registerViewClass:[WebPluginDocumentView class] representationClass:[WebPluginDocumentView class] forMIMEType:MIMEType];
-        }
         
+        [WebView registerViewClass:[WebHTMLView class] representationClass:[WebHTMLRepresentation class] forMIMEType:MIMEType];
     }
 }
 
diff --git a/WebKit/Plugins/WebPluginDocumentView.h b/WebKit/Plugins/WebPluginDocumentView.h
deleted file mode 100644 (file)
index 2817002..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
- */
-
-#import <WebKit/WebDocument.h>
-
-@class WebPluginController;
-@class WebPluginPackage;
-
-@interface WebPluginDocumentView : NSView <WebDocumentView, WebDocumentRepresentation>
-{
-    NSView *pluginView;
-    WebPluginController *pluginController;
-    WebPluginPackage *plugin;
-    WebDataSource *_dataSource;
-    BOOL dataSourceHasBeenSet;
-    BOOL needsLayout;
-}
-
-@end
diff --git a/WebKit/Plugins/WebPluginDocumentView.m b/WebKit/Plugins/WebPluginDocumentView.m
deleted file mode 100644 (file)
index 3f7c541..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
- */
-
-#import <WebKit/WebPluginDocumentView.h>
-
-#import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebFrameView.h>
-#import <WebKit/WebKitErrorsPrivate.h>
-#import <WebKit/WebNSURLExtras.h>
-#import <WebKit/WebNSViewExtras.h>
-#import <WebKit/WebPlugin.h>
-#import <WebKit/WebPluginPrivate.h>
-#import <WebKit/WebPluginController.h>
-#import <WebKit/WebPluginDatabase.h>
-#import <WebKit/WebPluginPackage.h>
-#import <WebKit/WebPluginViewFactoryPrivate.h>
-#import <WebKit/WebView.h>
-
-@implementation WebPluginDocumentView
-
-- initWithFrame:(NSRect)frame
-{
-    [super initWithFrame:frame];
-    [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    needsLayout = YES;
-    pluginController = [[WebPluginController alloc] initWithDocumentView:self];
-    return self;
-}
-
-- (void)dealloc
-{
-    [pluginView release];
-    [plugin release];
-    [pluginController destroyAllPlugins];
-    [pluginController release];
-    [_dataSource release];
-    [super dealloc];
-}
-
-- (void)drawRect:(NSRect)rect
-{
-    if (needsLayout) {
-        [self layout];
-    }
-    [super drawRect:rect];
-}
-
-- (void)setDataSource:(WebDataSource *)dataSource
-{
-    // Since this class is a WebDocumentView and WebDocumentRepresentation, setDataSource: will be called twice. Do work only once.
-    if (dataSourceHasBeenSet)
-        return;
-    
-    // As noted above, -setDataSource: will be called twice -- once for the WebDocumentRepresentation, once for the WebDocumentView.
-    // We don't want to make the plugin until we know we're being committed as the WebDocumentView for the WebFrame.  This check is
-    // to ensure that we've been added to the view hierarchy before attempting to create the plugin, as some plugins currently work
-    // under this assumption.
-    if (![self superview])
-        return;
-        
-    _dataSource = [dataSource retain];
-    [pluginController setDataSource:dataSource];
-    dataSourceHasBeenSet = YES;
-    
-    NSURLResponse *response = [dataSource response];
-    NSString *MIMEType = [response MIMEType];    
-    plugin = (WebPluginPackage *)[[[WebPluginDatabase installedPlugins] pluginForMIMEType:MIMEType] retain];
-    ASSERT([plugin isKindOfClass:[WebPluginPackage class]]);
-    
-    NSURL *URL = [response URL];
-    NSString *URLString = [URL _web_originalDataAsString];
-    NSDictionary *attributes = [[NSDictionary alloc] initWithObjectsAndKeys:MIMEType, @"type", URLString, @"src", nil];
-    NSDictionary *arguments = [[NSDictionary alloc] initWithObjectsAndKeys:
-        URL,                WebPlugInBaseURLKey,
-        attributes,         WebPlugInAttributesKey,
-        pluginController,   WebPlugInContainerKey,
-        [NSNumber numberWithInt:WebPlugInModeFull], WebPlugInModeKey,
-        [NSNumber numberWithBool:NO], WebPlugInShouldLoadMainResourceKey, // NO because we're already loading the data!
-        nil];
-    [attributes release];
-    pluginView = [[WebPluginController plugInViewWithArguments:arguments fromPluginPackage:plugin] retain];
-    [arguments release];
-
-    ASSERT(pluginView != nil);
-
-    [self addSubview:pluginView];
-    [pluginController addPlugin:pluginView];
-    [pluginView setFrame:[self bounds]];
-    [pluginView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    
-    if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidReceiveResponse:)])
-        [pluginView webPlugInMainResourceDidReceiveResponse:[dataSource response]];
-}
-
-- (void)dataSourceUpdated:(WebDataSource *)dataSource
-{
-    if (![pluginView respondsToSelector:@selector(webPlugInMainResourceDidReceiveData:)]) {
-        // Cancel the load since this plug-in does its own loading.
-        NSURLResponse *response = [dataSource response];
-        // FIXME: See <rdar://problem/4258008>
-        NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInWillHandleLoad
-                                                        contentURL:[response URL]
-                                                     pluginPageURL:nil
-                                                        pluginName:[plugin name]
-                                                          MIMEType:[response MIMEType]];
-        [dataSource _stopLoadingWithError:error];
-        [error release];
-    }
-}
-
-- (void)setNeedsLayout:(BOOL)flag
-{
-    needsLayout = flag;
-}
-
-- (void)layout
-{
-    NSRect superFrame = [[[_dataSource webFrame] frameView] frame];
-    [self setFrame:NSMakeRect(0, 0, NSWidth(superFrame), NSHeight(superFrame))];
-    needsLayout = NO;    
-}
-
-- (NSWindow *)currentWindow
-{
-    NSWindow *window = [self window];
-    return window != nil ? window : [[_dataSource _webView] hostWindow];
-}
-
-- (void)viewWillMoveToWindow:(NSWindow *)window
-{
-    if ([[_dataSource _webView] hostWindow] == nil) {
-        [pluginController stopAllPlugins];
-    }
-}
-
-- (void)viewDidMoveToWindow
-{
-    if ([self currentWindow] != nil) {
-        [pluginController startAllPlugins];
-    }
-}
-
-- (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow
-{
-    if ([self window] == nil) {
-        [pluginController stopAllPlugins];
-    }
-}
-
-- (void)viewDidMoveToHostWindow
-{
-    if ([self currentWindow] != nil) {
-        [pluginController startAllPlugins];
-    }    
-}
-
-- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
-{
-    if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidReceiveData:)])
-        [pluginView webPlugInMainResourceDidReceiveData:data];
-}
-
-- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource
-{
-    if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidFailWithError:)])
-        [pluginView webPlugInMainResourceDidFailWithError:error];
-}
-
-- (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
-{
-    if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidFinishLoading)])
-        [pluginView webPlugInMainResourceDidFinishLoading];
-}
-
-- (BOOL)canProvideDocumentSource
-{
-    return NO;
-}
-
-- (NSString *)documentSource
-{
-    return nil;
-}
-
-- (NSString *)title
-{
-    return nil;
-}
-
-@end
index d845bc038305cbc4663df7c67bc549c97fbfcd18..ef029feb0c022531e336710a937718ac4fd44de9 100644 (file)
@@ -56,7 +56,6 @@
 #import "WebNSURLExtras.h"
 #import "WebNSURLRequestExtras.h"
 #import "WebNSViewExtras.h"
-#import "WebNetscapePluginDocumentView.h"
 #import "WebNetscapePluginEmbeddedView.h"
 #import "WebNetscapePluginPackage.h"
 #import "WebNullPluginView.h"
@@ -64,7 +63,6 @@
 #import "WebPlugin.h"
 #import "WebPluginController.h"
 #import "WebPluginDatabase.h"
-#import "WebPluginDocumentView.h"
 #import "WebPluginPackage.h"
 #import "WebPluginViewFactoryPrivate.h"
 #import "WebPreferencesPrivate.h"
@@ -874,6 +872,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                   attributeValues:(NSArray *)attributeValues
                           baseURL:(NSURL *)baseURL
                        DOMElement:(DOMElement *)element
+                     loadManually:(BOOL)loadManually
 {
     WebHTMLView *docView = (WebHTMLView *)[[_frame frameView] documentView];
     ASSERT([docView isKindOfClass:[WebHTMLView class]]);
@@ -894,8 +893,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
             baseURL, WebPlugInBaseURLKey,
             attributes, WebPlugInAttributesKey,
             pluginController, WebPlugInContainerKey,
-            [NSNumber numberWithInt:WebPlugInModeEmbed], WebPlugInModeKey,
-            [NSNumber numberWithBool:YES], WebPlugInShouldLoadMainResourceKey,
+            [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey,
+            [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey,
             element, WebPlugInContainingElementKey,
             nil];
         LOG(Plugins, "arguments:\n%@", arguments);
@@ -931,6 +930,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                  attributeValues:(NSArray *)attributeValues
                         MIMEType:(NSString *)MIMEType
                       DOMElement:(DOMElement *)element
+                    loadManually:(BOOL)loadManually
 {
     BOOL hideReferrer;
     if (![self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer])
@@ -949,9 +949,9 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
         NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjects:attributeValues forKeys:attributeNames];
         NSDictionary *arguments = [NSDictionary dictionaryWithObjectsAndKeys:
             attributes, WebPlugInAttributesKey,
-            [NSNumber numberWithInt:WebPlugInModeEmbed], WebPlugInModeKey,
+            [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey,
             URL, WebPlugInBaseURLKey, // URL might be nil, so add it last
-            [NSNumber numberWithBool:YES], WebPlugInShouldLoadMainResourceKey,
+            [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey,
             element, WebPlugInContainingElementKey,
             nil];
         [attributes release];
@@ -982,7 +982,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                                 attributeNames:attributeNames
                                attributeValues:attributeValues
                                        baseURL:baseURL
-                                    DOMElement:element];
+                                    DOMElement:element
+                                  loadManually:loadManually];
         } else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
             WebNetscapePluginEmbeddedView *embeddedView = [[[WebNetscapePluginEmbeddedView alloc] initWithFrame:NSZeroRect
                                                                   plugin:(WebNetscapePluginPackage *)pluginPackage
@@ -990,7 +991,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                                                                  baseURL:baseURL
                                                                 MIMEType:MIMEType
                                                            attributeKeys:attributeNames
-                                                         attributeValues:attributeValues] autorelease];
+                                                         attributeValues:attributeValues
+                                                            loadManually:loadManually] autorelease];
             view = embeddedView;
             [_frame _addPlugInView:embeddedView];
         } else
@@ -1019,6 +1021,21 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     return view;
 }
 
+- (void)redirectDataToPlugin:(NSView *)pluginView
+{
+    WebHTMLRepresentation *representation = (WebHTMLRepresentation *)[[_frame dataSource] representation];
+
+    if ([pluginView isKindOfClass:[WebNetscapePluginEmbeddedView class]])
+        [representation _redirectDataToManualLoader:(WebNetscapePluginEmbeddedView *)pluginView forPluginView:pluginView];
+    else {
+        WebHTMLView *docView = (WebHTMLView *)[[_frame frameView] documentView];
+        ASSERT([docView isKindOfClass:[WebHTMLView class]]);
+        
+        WebPluginController *pluginController = [docView _pluginController];
+        [representation _redirectDataToManualLoader:pluginController forPluginView:pluginView];
+    }
+}
+
 - (NSView *)viewForJavaAppletWithFrame:(NSRect)theFrame
                         attributeNames:(NSArray *)attributeNames
                        attributeValues:(NSArray *)attributeValues
@@ -1048,7 +1065,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                                 attributeNames:names
                                attributeValues:values
                                        baseURL:baseURL
-                                    DOMElement:element];
+                                    DOMElement:element
+                                  loadManually:NO];
             [names release];
             [values release];
         } else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
@@ -1058,7 +1076,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                                                                  baseURL:baseURL
                                                                 MIMEType:MIMEType
                                                            attributeKeys:attributeNames
-                                                         attributeValues:attributeValues] autorelease];
+                                                         attributeValues:attributeValues
+                                                            loadManually:NO] autorelease];
         } else {
             ASSERT_NOT_REACHED();
         }
@@ -1118,24 +1137,14 @@ static BOOL loggedObjectCacheSize = NO;
 
     if ([MIMEType length] == 0)
         return ObjectElementFrame; // Go ahead and hope that we can display the content.
-                
-    Class viewClass = [WebFrameView _viewClassForMIMEType:MIMEType];
-    if (!viewClass) {
-        // No view class is registered to handle this MIME type.  Check to see if there is a plugin which can handle this MIME type.
-        // This check is required because the Java plugin does not register an NSView class, so that Java files are downloaded when 
-        // not embedded.
-        if ([[WebPluginDatabase installedPlugins] pluginForMIMEType:MIMEType])
-            return ObjectElementPlugin;
-        else
-            return ObjectElementNone;
-    }
-    
-    // If we're a supported type other than a plugin, we want to make a frame.
-    // Ultimately we should just use frames for all mime types (plugins and HTML/XML/text documents),
-    // but for now we're burdened with making a distinction between the two.
-    if ([viewClass isSubclassOfClass:[WebNetscapePluginDocumentView class]] || [viewClass isSubclassOfClass:[WebPluginDocumentView class]])
+
+    if ([[WebPluginDatabase installedPlugins] pluginForMIMEType:MIMEType])
         return ObjectElementPlugin;
-    return ObjectElementFrame;
+
+    if ([WebFrameView _viewClassForMIMEType:MIMEType])
+        return ObjectElementFrame;
+    
+    return ObjectElementNone;
 }
 
 - (void)loadEmptyDocumentSynchronously
index 4aece737066837949f8a35345a0300b900712717..ec54392f51dacddd7e36224dfc6a6ce84398c837 100644 (file)
     }
 }
 
+- (BOOL)pluginSupportsMIMEType:(NSString *)MIMEType
+{
+    return [[WebPluginDatabase installedPlugins] pluginForMIMEType:MIMEType] != nil;
+}
+
 - (WebCoreFrameBridge *)bridgeForView:(NSView *)v
 {
     NSView *aView = [v superview];
index 07f0b5fff0a72b94dd45802f661e089ef8c627e0..d47f49a9614d281f9bc4d94932b5dabf53e11d42 100644 (file)
                9398102C0824BF01008DF038 /* WebBaseNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = F5EBC45502134BC301CA1520 /* WebBaseNetscapePluginView.h */; };
                9398102D0824BF01008DF038 /* WebBaseNetscapePluginViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 931A72D203265920008635CE /* WebBaseNetscapePluginViewPrivate.h */; };
                9398102E0824BF01008DF038 /* WebBasePluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E4AF46036652150000E506 /* WebBasePluginPackage.h */; };
-               9398102F0824BF01008DF038 /* WebNetscapePluginDocumentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D4BFFB0348EF9D00CA2ACA /* WebNetscapePluginDocumentView.h */; };
                939810300824BF01008DF038 /* WebNetscapePluginEmbeddedView.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D4BFF70348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.h */; };
                939810310824BF01008DF038 /* WebNetscapePluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */; };
-               939810320824BF01008DF038 /* WebNetscapePluginRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 83402EF6035A588900BE770A /* WebNetscapePluginRepresentation.h */; };
                939810330824BF01008DF038 /* WebNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 83402EFA035A58D100BE770A /* WebNetscapePluginStream.h */; };
                939810340824BF01008DF038 /* WebNullPluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = F5883BE0025E5E9D01000102 /* WebNullPluginView.h */; };
                939810350824BF01008DF038 /* WebPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 848DFF840365FE6A00CA2ACA /* WebPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
                939810A70824BF01008DF038 /* WebFormDataStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B641FA06E292BC0055F610 /* WebFormDataStream.h */; };
                939810A80824BF01008DF038 /* WebPreferenceKeysPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE850CD06ECC79E005FAB05 /* WebPreferenceKeysPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939810AA0824BF01008DF038 /* WebDashboardRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 9305892A070868B300E79D96 /* WebDashboardRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               939810AB0824BF01008DF038 /* WebPluginDocumentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 832D7E030709D8FB00F49B61 /* WebPluginDocumentView.h */; };
                939810AC0824BF01008DF038 /* WebPluginViewFactoryPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939810AF0824BF01008DF038 /* WebFrameViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C6F14507920B93002449CD /* WebFrameViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939810B00824BF01008DF038 /* WebPluginContainerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939810D10824BF01008DF038 /* WebBaseNetscapePluginStream.m in Sources */ = {isa = PBXBuildFile; fileRef = F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.m */; };
                939810D20824BF01008DF038 /* WebBaseNetscapePluginView.m in Sources */ = {isa = PBXBuildFile; fileRef = F5EBC45602134BC301CA1520 /* WebBaseNetscapePluginView.m */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
                939810D30824BF01008DF038 /* WebBasePluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF47036652150000E506 /* WebBasePluginPackage.m */; };
-               939810D40824BF01008DF038 /* WebNetscapePluginDocumentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D4BFFC0348EF9D00CA2ACA /* WebNetscapePluginDocumentView.m */; };
                939810D50824BF01008DF038 /* WebNetscapePluginEmbeddedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D4BFF80348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.m */; };
                939810D60824BF01008DF038 /* WebNetscapePluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = F5F7171F0288493C018635CA /* WebNetscapePluginPackage.m */; };
-               939810D70824BF01008DF038 /* WebNetscapePluginRepresentation.m in Sources */ = {isa = PBXBuildFile; fileRef = 83402EF7035A588900BE770A /* WebNetscapePluginRepresentation.m */; };
                939810D80824BF01008DF038 /* WebNetscapePluginStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 83402EFB035A58D100BE770A /* WebNetscapePluginStream.m */; };
                939810D90824BF01008DF038 /* WebNullPluginView.m in Sources */ = {isa = PBXBuildFile; fileRef = F5883BE1025E5E9D01000102 /* WebNullPluginView.m */; };
                939810DA0824BF01008DF038 /* WebPluginController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8467275D0367158500CA2ACA /* WebPluginController.m */; };
                9398111E0824BF01008DF038 /* WebPDFView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E94C3506C0321200A9B09E /* WebPDFView.m */; };
                9398111F0824BF01008DF038 /* WebPDFRepresentation.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E94C6906C0347500A9B09E /* WebPDFRepresentation.m */; };
                939811210824BF01008DF038 /* WebFormDataStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 93B641F906E292BC0055F610 /* WebFormDataStream.m */; };
-               939811230824BF01008DF038 /* WebPluginDocumentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 832D7E040709D8FB00F49B61 /* WebPluginDocumentView.m */; };
                939811260824BF01008DF038 /* WebPluginContainerCheck.m in Sources */ = {isa = PBXBuildFile; fileRef = 65E1150407EFFEBF009B8BF7 /* WebPluginContainerCheck.m */; };
                939811280824BF01008DF038 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869302846DCD018635CA /* ApplicationServices.framework */; };
                939811290824BF01008DF038 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869402846DCD018635CA /* Carbon.framework */; };
                ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 /* End PBXBuildFile section */
 
-/* Begin PBXBuildStyle section */
-               BCF532600A38D00E00976994 /* Development */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                       };
-                       name = Development;
-               };
-               BCF532610A38D00E00976994 /* Deployment */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                       };
-                       name = Deployment;
-               };
-/* End PBXBuildStyle section */
-
 /* Begin PBXFileReference section */
                1C68F640095B5FC100C2984E /* webInspector */ = {isa = PBXFileReference; lastKnownFileType = folder; name = webInspector; path = WebInspector/webInspector; sourceTree = SOURCE_ROOT; };
                1C68F65C095B5FC100C2984E /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebScriptDebugDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                7E6FEF0708985A7200C44C3F /* WebScriptDebugDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                830E81E005853AC000AD0891 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
-               832D7E030709D8FB00F49B61 /* WebPluginDocumentView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginDocumentView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               832D7E040709D8FB00F49B61 /* WebPluginDocumentView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginDocumentView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                833987810543012D00EE146E /* WebDocumentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocumentPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               83402EF6035A588900BE770A /* WebNetscapePluginRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               83402EF7035A588900BE770A /* WebNetscapePluginRepresentation.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginRepresentation.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                83402EFA035A58D100BE770A /* WebNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginStream.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                83402EFB035A58D100BE770A /* WebNetscapePluginStream.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginStream.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                83730F9803FB1E660004736E /* WebKitErrors.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitErrors.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                84CA5F7E042685E800CA2ACA /* WebKitErrorsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitErrorsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                84D4BFF70348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEmbeddedView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                84D4BFF80348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginEmbeddedView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               84D4BFFB0348EF9D00CA2ACA /* WebNetscapePluginDocumentView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginDocumentView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               84D4BFFC0348EF9D00CA2ACA /* WebNetscapePluginDocumentView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginDocumentView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                9305892A070868B300E79D96 /* WebDashboardRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDashboardRegion.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                930D02BB06275F640076701E /* WebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                930D02BD06275F710076701E /* WebFrameInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                2203984A0922D765009C3FFC /* WebBaseNetscapePluginViewInternal.h */,
                                931A72D203265920008635CE /* WebBaseNetscapePluginViewPrivate.h */,
                                F5EBC45602134BC301CA1520 /* WebBaseNetscapePluginView.m */,
-                               84D4BFFB0348EF9D00CA2ACA /* WebNetscapePluginDocumentView.h */,
-                               84D4BFFC0348EF9D00CA2ACA /* WebNetscapePluginDocumentView.m */,
                                84D4BFF70348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.h */,
                                84D4BFF80348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.m */,
                                F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */,
                                F5F7171F0288493C018635CA /* WebNetscapePluginPackage.m */,
-                               83402EF6035A588900BE770A /* WebNetscapePluginRepresentation.h */,
-                               83402EF7035A588900BE770A /* WebNetscapePluginRepresentation.m */,
                                83402EFA035A58D100BE770A /* WebNetscapePluginStream.h */,
                                83402EFB035A58D100BE770A /* WebNetscapePluginStream.m */,
                                226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */,
                                65E1150407EFFEBF009B8BF7 /* WebPluginContainerCheck.m */,
                                8467275C0367158500CA2ACA /* WebPluginController.h */,
                                8467275D0367158500CA2ACA /* WebPluginController.m */,
-                               832D7E030709D8FB00F49B61 /* WebPluginDocumentView.h */,
-                               832D7E040709D8FB00F49B61 /* WebPluginDocumentView.m */,
                                83E4AF4B036659440000E506 /* WebPluginPackage.h */,
                                83E4AF4C036659440000E506 /* WebPluginPackage.m */,
                                848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */,
                                9398102C0824BF01008DF038 /* WebBaseNetscapePluginView.h in Headers */,
                                9398102D0824BF01008DF038 /* WebBaseNetscapePluginViewPrivate.h in Headers */,
                                9398102E0824BF01008DF038 /* WebBasePluginPackage.h in Headers */,
-                               9398102F0824BF01008DF038 /* WebNetscapePluginDocumentView.h in Headers */,
                                939810300824BF01008DF038 /* WebNetscapePluginEmbeddedView.h in Headers */,
                                939810310824BF01008DF038 /* WebNetscapePluginPackage.h in Headers */,
-                               939810320824BF01008DF038 /* WebNetscapePluginRepresentation.h in Headers */,
                                939810330824BF01008DF038 /* WebNetscapePluginStream.h in Headers */,
                                939810340824BF01008DF038 /* WebNullPluginView.h in Headers */,
                                939810350824BF01008DF038 /* WebPlugin.h in Headers */,
                                939810A70824BF01008DF038 /* WebFormDataStream.h in Headers */,
                                939810A80824BF01008DF038 /* WebPreferenceKeysPrivate.h in Headers */,
                                939810AA0824BF01008DF038 /* WebDashboardRegion.h in Headers */,
-                               939810AB0824BF01008DF038 /* WebPluginDocumentView.h in Headers */,
                                939810AC0824BF01008DF038 /* WebPluginViewFactoryPrivate.h in Headers */,
                                939810AF0824BF01008DF038 /* WebFrameViewPrivate.h in Headers */,
                                939810B00824BF01008DF038 /* WebPluginContainerPrivate.h in Headers */,
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
-                       buildSettings = {
-                       };
-                       buildStyles = (
-                               BCF532600A38D00E00976994 /* Development */,
-                               BCF532610A38D00E00976994 /* Deployment */,
-                       );
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                                939810D10824BF01008DF038 /* WebBaseNetscapePluginStream.m in Sources */,
                                939810D20824BF01008DF038 /* WebBaseNetscapePluginView.m in Sources */,
                                939810D30824BF01008DF038 /* WebBasePluginPackage.m in Sources */,
-                               939810D40824BF01008DF038 /* WebNetscapePluginDocumentView.m in Sources */,
                                939810D50824BF01008DF038 /* WebNetscapePluginEmbeddedView.m in Sources */,
                                939810D60824BF01008DF038 /* WebNetscapePluginPackage.m in Sources */,
-                               939810D70824BF01008DF038 /* WebNetscapePluginRepresentation.m in Sources */,
                                939810D80824BF01008DF038 /* WebNetscapePluginStream.m in Sources */,
                                939810D90824BF01008DF038 /* WebNullPluginView.m in Sources */,
                                939810DA0824BF01008DF038 /* WebPluginController.m in Sources */,
                                9398111E0824BF01008DF038 /* WebPDFView.m in Sources */,
                                9398111F0824BF01008DF038 /* WebPDFRepresentation.m in Sources */,
                                939811210824BF01008DF038 /* WebFormDataStream.m in Sources */,
-                               939811230824BF01008DF038 /* WebPluginDocumentView.m in Sources */,
                                939811260824BF01008DF038 /* WebPluginContainerCheck.m in Sources */,
                                65488DA2084FBCCB00831AD0 /* WebNSDictionaryExtras.m in Sources */,
                                65EEDE54084FFB920002DB25 /* WebNSCalendarDateExtras.m in Sources */,
index 986e373d19aef74df41ab858fa8b109358b8c3f6..7b4273fc7d10a88a93b4d8882bb356320d91e5c8 100644 (file)
@@ -49,7 +49,6 @@
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebKitNSStringExtras.h>
 #import <WebKit/WebKitStatisticsPrivate.h>
-#import <WebKit/WebNetscapePluginDocumentView.h>
 #import <WebKit/WebNetscapePluginEmbeddedView.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSURLExtras.h>
@@ -58,7 +57,6 @@
 #import <WebKit/WebPreferencesPrivate.h>
 #import <WebKit/WebPlugin.h>
 #import <WebKit/WebPluginController.h>
-#import <WebKit/WebPluginDocumentView.h>
 #import <WebKit/WebResourceLoadDelegate.h>
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebViewInternal.h>
@@ -2430,9 +2428,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 {
     for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
         NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
-        if ([documentView isKindOfClass:[WebNetscapePluginDocumentView class]] ||
-            [documentView isKindOfClass:[WebPluginDocumentView class]] ||
-            ([documentView isKindOfClass:[WebHTMLView class]] && [_private->bridge containsPlugins]))
+        if (([documentView isKindOfClass:[WebHTMLView class]] && [_private->bridge containsPlugins]))
             [frame reload];
     }
 }
@@ -2448,7 +2444,6 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 {
     for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
         NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
-        // FIXME: what about plugin document view?
         if ([documentView isKindOfClass:[WebHTMLView class]])
             [(WebHTMLView *)documentView _pauseNullEventsForAllNetscapePlugins];
     }
@@ -2457,7 +2452,6 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 - (void)_recursive_resumeNullEventsForAllNetscapePlugins
 {
     for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
-        // FIXME: what about plugin document view?
         NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
         if ([documentView isKindOfClass:[WebHTMLView class]])
             [(WebHTMLView *)documentView _resumeNullEventsForAllNetscapePlugins];
index 98d87ef8aa0a767889162fba1d6440c9cb4d0d23..a214c57a4205078e60473bb2ba61174305cd531d 100644 (file)
@@ -29,6 +29,7 @@
 #import "WebHTMLRepresentation.h"
 
 #import "WebArchive.h"
+#import "WebBasePluginPackage.h"
 #import "WebDataSourceInternal.h"
 #import "WebDocumentPrivate.h"
 #import "WebFrameBridge.h"
     WebDataSource *dataSource;
     WebFrameBridge *bridge;
     NSData *parsedArchiveData;
+    
+    BOOL hasSentResponseToPlugin;
+    id <WebPluginManualLoader> manualLoader;
+    NSView *pluginView;
 }
 @end
 
     return _private->bridge;
 }
 
+- (void)_redirectDataToManualLoader:(id<WebPluginManualLoader>)manualLoader forPluginView:(NSView *)pluginView;
+{
+    _private->manualLoader = manualLoader;
+    _private->pluginView = pluginView;
+}
+
 - (void)setDataSource:(WebDataSource *)dataSource
 {
     _private->dataSource = dataSource;
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
 {
     if ([dataSource webFrame] && ![self _isDisplayingWebArchive]) {
-        [_private->bridge receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]];
+        if (!_private->pluginView)
+            [_private->bridge receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]];
+
+        if (_private->pluginView) {
+            if (!_private->hasSentResponseToPlugin) {
+                [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]];
+                _private->hasSentResponseToPlugin = YES;
+            }
+            
+            [_private->manualLoader pluginView:_private->pluginView receivedData:data];
+        }
     }
 }
 
 - (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource
 {
+    if (_private->pluginView) {
+        [_private->manualLoader pluginView:_private->pluginView receivedError:error];
+    }
 }
 
 - (void)loadArchive
 - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
 {
     WebFrame *frame = [dataSource webFrame];
+
+    if (_private->pluginView) {
+        [_private->manualLoader pluginViewFinishedLoading:_private->pluginView];
+        return;
+    }
+
     if (frame) {
         if ([self _isDisplayingWebArchive]) {
             [self loadArchive];
index 1b2ee688ebd9f7b7fb1a62337575e42f96909348..3737bb2c9a7be05b1f8eea69ec5acedf043d303b 100644 (file)
 #import <WebKit/WebHTMLRepresentation.h>
 
 @class WebFrameBridge;
+@protocol WebPluginManualLoader;
 
 @interface WebHTMLRepresentation (WebPrivate)
 - (WebFrameBridge *)_bridge;
+- (void)_redirectDataToManualLoader:(id<WebPluginManualLoader>)manualLoader forPluginView:(NSView *)pluginView;
 - (void)printDOMTree;
 @end