2008-03-07 Simon Hausmann <hausmann@webkit.org>
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Mar 2008 11:52:27 +0000 (11:52 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Mar 2008 11:52:27 +0000 (11:52 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=16815

        Reviewed by Darin.

        Done with Lars.

WebCore:

        Ported the manually written JS bindings of window.navigator,
        window.navigator.plugins and window.navigator.mimeTypes to
        auto-generated bindings.

        Moved the globally cached plugin and mimetype information to a
        per WebCore::Page shared PluginData structure.

        Implemented window.navigator.plugins.refresh() in a
        platform-independent way.

LayoutTests:

        Added a testcase for http://bugs.webkit.org/show_bug.cgi?id=16815

WebKit/qt:

        Replaced the QWebObjectPlugin interfaces with QWebPluginFactory.

WebKit/mac:

        Simplified WebViewFactory's refreshPlugins method to only refresh the
        plugins and not reload the frames anymore since that's now done in a
        platform independent manner by WebCore::Page.

        Also removed the now unused pluginNameForMIMEType and
        pluginSupportsMIMEType methods.

WebKitTools/DumpRenderTree/qt:

        Ported the netscape test plugin to QWebPluginFactory.

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

82 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/js/navigator-plugins-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/navigator-plugins-crash.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/GNUmakefile.am
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSDOMWindowBase.cpp
WebCore/bindings/js/JSMimeTypeArrayCustom.cpp [new file with mode: 0644]
WebCore/bindings/js/JSNavigatorCustom.cpp [new file with mode: 0644]
WebCore/bindings/js/JSPluginArrayCustom.cpp [new file with mode: 0644]
WebCore/bindings/js/JSPluginCustom.cpp [new file with mode: 0644]
WebCore/bindings/js/kjs_navigator.cpp [deleted file]
WebCore/bindings/js/kjs_navigator.h [deleted file]
WebCore/dom/Clipboard.cpp
WebCore/dom/DOMImplementation.cpp
WebCore/loader/FrameLoader.cpp
WebCore/page/DOMWindow.cpp
WebCore/page/DOMWindow.h
WebCore/page/DOMWindow.idl
WebCore/page/DragController.cpp
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/Navigator.cpp [new file with mode: 0644]
WebCore/page/Navigator.h [new file with mode: 0644]
WebCore/page/Navigator.idl [new file with mode: 0644]
WebCore/page/Page.cpp
WebCore/page/Page.h
WebCore/page/Plugin.h [deleted file]
WebCore/page/mac/FrameMac.mm
WebCore/page/mac/WebCoreFrameBridge.mm
WebCore/page/mac/WebCoreViewFactory.h
WebCore/page/qt/FrameQt.cpp
WebCore/page/win/FrameWin.cpp
WebCore/platform/gtk/TemporaryLinkStubs.cpp
WebCore/platform/mac/PlugInInfoStoreMac.mm [deleted file]
WebCore/platform/qt/MIMETypeRegistryQt.cpp
WebCore/plugins/MimeType.cpp [new file with mode: 0644]
WebCore/plugins/MimeType.h [new file with mode: 0644]
WebCore/plugins/MimeType.idl [new file with mode: 0644]
WebCore/plugins/MimeTypeArray.cpp [new file with mode: 0644]
WebCore/plugins/MimeTypeArray.h [new file with mode: 0644]
WebCore/plugins/MimeTypeArray.idl [new file with mode: 0644]
WebCore/plugins/Plugin.cpp [new file with mode: 0644]
WebCore/plugins/Plugin.h [new file with mode: 0644]
WebCore/plugins/Plugin.idl [new file with mode: 0644]
WebCore/plugins/PluginArray.cpp [new file with mode: 0644]
WebCore/plugins/PluginArray.h [new file with mode: 0644]
WebCore/plugins/PluginArray.idl [new file with mode: 0644]
WebCore/plugins/PluginData.cpp [new file with mode: 0644]
WebCore/plugins/PluginData.h [new file with mode: 0644]
WebCore/plugins/mac/PluginDataMac.mm [new file with mode: 0644]
WebCore/plugins/qt/PluginDataQt.cpp [new file with mode: 0644]
WebCore/plugins/win/PluginDataWin.cpp [new file with mode: 0644]
WebKit.pri
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebViewFactory.mm
WebKit/mac/WebView/WebFrame.mm
WebKit/mac/WebView/WebFrameInternal.h
WebKit/mac/WebView/WebView.mm
WebKit/qt/Api/qwebnetworkinterface.cpp
WebKit/qt/Api/qwebnetworkinterface_p.h
WebKit/qt/Api/qwebobjectplugin.cpp [deleted file]
WebKit/qt/Api/qwebobjectplugin.h [deleted file]
WebKit/qt/Api/qwebobjectplugin_p.h [deleted file]
WebKit/qt/Api/qwebobjectpluginconnector.cpp [deleted file]
WebKit/qt/Api/qwebobjectpluginconnector.h [deleted file]
WebKit/qt/Api/qwebpage.cpp
WebKit/qt/Api/qwebpage.h
WebKit/qt/Api/qwebpage_p.h
WebKit/qt/Api/qwebpluginfactory.cpp [new file with mode: 0644]
WebKit/qt/Api/qwebpluginfactory.h [new file with mode: 0644]
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/qt/main.cpp
WebKitTools/DumpRenderTree/qt/testplugin.cpp
WebKitTools/DumpRenderTree/qt/testplugin.h

index ea3e44d545f0cb0c08c47c80749f8b30677e5a48..37a67d7b582aa2445cbbe1086815d6855b2842bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-03-07  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Darin.
+
+        Done with Lars.
+
+        Added plugins subdirectory to the include path.
+
+        * WebKit.pri:
+
 2008-03-09  Alp Toker  <alp@atoker.com>
 
         GTK+ build fix for r30913.
index d640d2f78e565259c57b1d3c75bb4763da6ee489..694a730a1d9ad498c601336ba7f05d320c47ebad 100644 (file)
@@ -1,3 +1,14 @@
+2008-03-07  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Darin.
+
+        Done with Lars.
+
+        Added a testcase for http://bugs.webkit.org/show_bug.cgi?id=16815
+
+        * fast/js/navigator-plugins-crash-expected.txt: Added.
+        * fast/js/navigator-plugins-crash.html: Added.
+
 2008-03-08 Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Sam W.
diff --git a/LayoutTests/fast/js/navigator-plugins-crash-expected.txt b/LayoutTests/fast/js/navigator-plugins-crash-expected.txt
new file mode 100644 (file)
index 0000000..6d7976e
--- /dev/null
@@ -0,0 +1 @@
+Tests access to previously received arrays from navigator.plugins and mimetypes after calling plugins.refresh(). If this text appears and there is no crash, then the test succeeded.
diff --git a/LayoutTests/fast/js/navigator-plugins-crash.html b/LayoutTests/fast/js/navigator-plugins-crash.html
new file mode 100644 (file)
index 0000000..c64ff94
--- /dev/null
@@ -0,0 +1,38 @@
+<html>
+<script>
+
+if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+var plugins = new Array;
+for (var i = 0; i < navigator.plugins.length; ++i) {
+    plugins.push(navigator.plugins[i]);
+}
+
+var mimeTypes = new Array;
+for (var i = 0; i < navigator.mimeTypes.length; ++i) {
+    mimeTypes.push(navigator.mimeTypes[i]);
+}
+
+navigator.plugins.refresh();
+
+var output = "<pre>";
+
+for (var i = 0; i < plugins.length; ++i) {
+    output += plugins[i].name;
+    output += "\n";
+}
+
+for (var i = 0; i < mimeTypes.length; ++i) {
+    output += mimeTypes[i].type;
+    output += "\n";
+}
+
+output += "</pre>";
+
+//document.writeln(output);
+document.writeln("Tests access to previously received arrays from navigator.plugins and mimetypes after calling plugins.refresh(). If this text appears and there is no crash, then the test succeeded.");
+
+</script>
+<body>
+</body></html>
index 1b301ce3b901a913ce7130cfd2ff7436006166d6..2cdbafcad0ee3a17cda696bb50fae8c41443aca3 100644 (file)
@@ -1,3 +1,160 @@
+2008-03-07  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Darin.
+
+        Done with Lars.
+
+        http://bugs.webkit.org/show_bug.cgi?id=16815
+
+        Ported the manually written JS bindings of window.navigator,
+        window.navigator.plugins and window.navigator.mimeTypes to
+        auto-generated bindings.
+
+        Moved the globally cached plugin and mimetype information to a
+        per WebCore::Page shared PluginData structure.
+
+        Implemented window.navigator.plugins.refresh() in a
+        platform-independent way.
+
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::getValueProperty):
+        * bindings/js/JSMimeTypeArrayCustom.cpp: Added.
+        (WebCore::JSMimeTypeArray::canGetItemsForName):
+        (WebCore::JSMimeTypeArray::nameGetter):
+        * bindings/js/JSNavigatorCustom.cpp: Added.
+        (WebCore::needsYouTubeQuirk):
+        (WebCore::JSNavigator::appVersion):
+        * bindings/js/JSPluginArrayCustom.cpp: Added.
+        (WebCore::JSPluginArray::canGetItemsForName):
+        (WebCore::JSPluginArray::nameGetter):
+        * bindings/js/JSPluginCustom.cpp: Added.
+        (WebCore::JSPlugin::canGetItemsForName):
+        (WebCore::JSPlugin::nameGetter):
+        * bindings/js/kjs_navigator.cpp: Removed.
+        * bindings/js/kjs_navigator.h: Removed.
+        * dom/Clipboard.cpp:
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::shouldUsePlugin):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::clear):
+        (WebCore::DOMWindow::navigator):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+        * page/DragController.cpp:
+        * page/Frame.cpp:
+        * page/Frame.h:
+        * page/Navigator.cpp: Added.
+        (WebCore::Navigator::Navigator):
+        (WebCore::Navigator::~Navigator):
+        (WebCore::Navigator::disconnectFrame):
+        (WebCore::Navigator::appCodeName):
+        (WebCore::Navigator::appName):
+        (WebCore::Navigator::appVersion):
+        (WebCore::Navigator::language):
+        (WebCore::Navigator::userAgent):
+        (WebCore::Navigator::platform):
+        (WebCore::Navigator::plugins):
+        (WebCore::Navigator::mimeTypes):
+        (WebCore::Navigator::product):
+        (WebCore::Navigator::productSub):
+        (WebCore::Navigator::vendor):
+        (WebCore::Navigator::vendorSub):
+        (WebCore::Navigator::cookieEnabled):
+        (WebCore::Navigator::javaEnabled):
+        * page/Navigator.h: Added.
+        (WebCore::Navigator::create):
+        (WebCore::Navigator::frame):
+        * page/Navigator.idl: Added.
+        * page/Page.cpp:
+        (WebCore::Page::refreshPlugins):
+        (WebCore::Page::pluginData):
+        * page/Page.h:
+        * page/Plugin.h: Removed.
+        * page/mac/FrameMac.mm:
+        * page/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge canProvideDocumentSource]):
+        * page/mac/WebCoreViewFactory.h:
+        * page/qt/FrameQt.cpp:
+        * page/win/FrameWin.cpp:
+        * platform/gtk/TemporaryLinkStubs.cpp:
+        * platform/mac/PlugInInfoStoreMac.mm: Removed.
+        * platform/qt/MIMETypeRegistryQt.cpp:
+        (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
+        * plugins/MimeType.cpp: Added.
+        (WebCore::MimeType::MimeType):
+        (WebCore::MimeType::~MimeType):
+        (WebCore::MimeType::type):
+        (WebCore::MimeType::suffixes):
+        (WebCore::MimeType::description):
+        (WebCore::MimeType::enabledPlugin):
+        * plugins/MimeType.h: Added.
+        (WebCore::MimeType::create):
+        * plugins/MimeType.idl: Added.
+        * plugins/MimeTypeArray.cpp: Added.
+        (WebCore::MimeTypeArray::MimeTypeArray):
+        (WebCore::MimeTypeArray::~MimeTypeArray):
+        (WebCore::MimeTypeArray::length):
+        (WebCore::MimeTypeArray::item):
+        (WebCore::MimeTypeArray::canGetItemsForName):
+        (WebCore::MimeTypeArray::nameGetter):
+        (WebCore::MimeTypeArray::getPluginData):
+        * plugins/MimeTypeArray.h: Added.
+        (WebCore::MimeTypeArray::create):
+        (WebCore::MimeTypeArray::disconnectFrame):
+        * plugins/MimeTypeArray.idl: Added.
+        * plugins/Plugin.cpp: Added.
+        (WebCore::Plugin::Plugin):
+        (WebCore::Plugin::~Plugin):
+        (WebCore::Plugin::name):
+        (WebCore::Plugin::filename):
+        (WebCore::Plugin::description):
+        (WebCore::Plugin::length):
+        (WebCore::Plugin::item):
+        (WebCore::Plugin::canGetItemsForName):
+        (WebCore::Plugin::nameGetter):
+        * plugins/Plugin.h: Added.
+        (WebCore::Plugin::create):
+        * plugins/Plugin.idl: Added.
+        * plugins/PluginArray.cpp: Added.
+        (WebCore::PluginArray::PluginArray):
+        (WebCore::PluginArray::~PluginArray):
+        (WebCore::PluginArray::length):
+        (WebCore::PluginArray::item):
+        (WebCore::PluginArray::canGetItemsForName):
+        (WebCore::PluginArray::nameGetter):
+        (WebCore::PluginArray::refresh):
+        (WebCore::PluginArray::getPluginData):
+        * plugins/PluginArray.h: Added.
+        (WebCore::PluginArray::create):
+        (WebCore::PluginArray::disconnectFrame):
+        * plugins/PluginArray.idl: Added.
+        * plugins/PluginData.cpp: Added.
+        (WebCore::PluginData::PluginData):
+        (WebCore::PluginData::~PluginData):
+        (WebCore::PluginData::supportsMimeType):
+        (WebCore::PluginData::pluginNameForMimeType):
+        * plugins/PluginData.h: Added.
+        (WebCore::PluginData::create):
+        (WebCore::PluginData::disconnectPage):
+        (WebCore::PluginData::page):
+        (WebCore::PluginData::plugins):
+        (WebCore::PluginData::mimes):
+        * plugins/mac/PluginDataMac.mm: Added.
+        (WebCore::PluginData::initPlugins):
+        (WebCore::PluginData::refresh):
+        * plugins/qt/PluginDataQt.cpp: Added.
+        (WebCore::PluginData::initPlugins):
+        * plugins/win/PluginDataWin.cpp: Added.
+        (WebCore::PluginData::initPlugins):
+        (WebCore::PluginData::refresh):
+
 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
 
         Reviewed by Holger.
index f5ef106e2f8094b58ea9cb19d9ce6f86c25085b9..52e447c0405886be2c2a317cf26be7224e0c4d35 100644 (file)
@@ -33,6 +33,7 @@ VPATH = \
     $(WebCore)/dom \
     $(WebCore)/html \
     $(WebCore)/page \
+    $(WebCore)/plugins \
     $(WebCore)/storage \
     $(WebCore)/xml \
     $(WebCore)/svg \
@@ -343,10 +344,14 @@ all : \
     JSDOMWindowBase.lut.h \
     JSEventTargetBase.lut.h \
     JSLocation.lut.h \
+    JSPlugin.h \
+    JSPluginArray.h \
+    JSNavigator.h \
+    JSMimeType.h \
+    JSMimeTypeArray.h \
     JSRGBColor.lut.h \
     JSXMLHttpRequest.lut.h \
     JSXSLTProcessor.lut.h \
-    kjs_navigator.lut.h \
     \
     JSHTMLInputElementBaseTable.cpp \
     \
index 16f2e07d8be6eecc796bb1e85f66b78c235475b2..2c0a77a569ce89d5a7837175d2e227e750810eb8 100644 (file)
@@ -54,7 +54,6 @@ webcore_built_nosources += \
        WebCore/bindings/js/JSRGBColor.lut.h \
        WebCore/bindings/js/JSXMLHttpRequest.lut.h \
        WebCore/bindings/js/JSXSLTProcessor.lut.h \
-       WebCore/bindings/js/kjs_navigator.lut.h \
        WebCore/bindings/js/JSHTMLInputElementBaseTable.cpp
 
 webcore_built_sources += \
@@ -171,15 +170,20 @@ webcore_built_sources += \
        DerivedSources/JSImageData.h \
        DerivedSources/JSKeyboardEvent.h \
        DerivedSources/JSMediaList.h \
+       DerivedSources/JSMimeType.h \
+       DerivedSources/JSMimeTypeArray.h \
        DerivedSources/JSMouseEvent.h \
        DerivedSources/JSMutationEvent.h \
        DerivedSources/JSNamedNodeMap.h \
+       DerivedSources/JSNavigator.h \
        DerivedSources/JSNode.h \
        DerivedSources/JSNodeFilter.h \
        DerivedSources/JSNodeIterator.h \
        DerivedSources/JSNodeList.h \
        DerivedSources/JSNotation.h \
        DerivedSources/JSOverflowEvent.h \
+       DerivedSources/JSPlugin.h \
+       DerivedSources/JSPluginArray.h \
        DerivedSources/JSProcessingInstruction.h \
        DerivedSources/JSProgressEvent.h \
        DerivedSources/JSRange.h \
@@ -297,15 +301,20 @@ webcore_built_sources += \
        DerivedSources/JSImageData.cpp \
        DerivedSources/JSKeyboardEvent.cpp \
        DerivedSources/JSMediaList.cpp \
+       DerivedSources/JSMimeType.cpp \
+       DerivedSources/JSMimeTypeArray.cpp \
        DerivedSources/JSMouseEvent.cpp \
        DerivedSources/JSMutationEvent.cpp \
        DerivedSources/JSNamedNodeMap.cpp \
+       DerivedSources/JSNavigator.cpp \
        DerivedSources/JSNode.cpp \
        DerivedSources/JSNodeFilter.cpp \
        DerivedSources/JSNodeIterator.cpp \
        DerivedSources/JSNodeList.cpp \
        DerivedSources/JSNotation.cpp \
        DerivedSources/JSOverflowEvent.cpp \
+       DerivedSources/JSPlugin.cpp \
+       DerivedSources/JSPluginArray.cpp \
        DerivedSources/JSProcessingInstruction.cpp \
        DerivedSources/JSProgressEvent.cpp \
        DerivedSources/JSRange.cpp \
@@ -443,7 +452,12 @@ IDL_BINDINGS +=  \
        WebCore/page/DOMSelection.idl \
        WebCore/page/DOMWindow.idl \
        WebCore/page/History.idl \
+       WebCore/page/Navigator.idl \
        WebCore/page/Screen.idl \
+       WebCore/plugins/MimeType.idl \
+       WebCore/plugins/MimeTypeArray.idl \
+       WebCore/plugins/Plugin.idl \
+       WebCore/plugins/PluginArray.idl \
        WebCore/xml/DOMParser.idl \
        WebCore/xml/XMLHttpRequestException.idl \
        WebCore/xml/XMLSerializer.idl
@@ -487,14 +501,18 @@ webcore_sources += \
        WebCore/bindings/js/JSHTMLOptionElementConstructor.cpp \
        WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp \
        WebCore/bindings/js/JSHTMLSelectElementCustom.cpp \
+       WebCore/bindings/js/JSMimeTypeArrayCustom.cpp \
        WebCore/bindings/js/JSNamedNodeMapCustom.cpp \
        WebCore/bindings/js/JSNamedNodesCollection.cpp  \
+       WebCore/bindings/js/JSNavigatorCustom.cpp  \
        WebCore/bindings/js/JSNodeCustom.cpp \
        WebCore/bindings/js/JSNodeFilterCondition.cpp \
        WebCore/bindings/js/JSNodeFilterCustom.cpp \
        WebCore/bindings/js/JSNodeIteratorCustom.cpp \
        WebCore/bindings/js/JSNodeListCustom.cpp \
        WebCore/bindings/js/JSRGBColor.cpp \
+       WebCore/bindings/js/JSPluginArrayCustom.cpp \
+       WebCore/bindings/js/JSPluginCustom.cpp \
        WebCore/bindings/js/JSStyleSheetCustom.cpp \
        WebCore/bindings/js/JSStyleSheetListCustom.cpp \
        WebCore/bindings/js/JSTreeWalkerCustom.cpp \
@@ -503,7 +521,6 @@ webcore_sources += \
        WebCore/bindings/js/kjs_binding.cpp \
        WebCore/bindings/js/kjs_events.cpp \
        WebCore/bindings/js/kjs_html.cpp \
-       WebCore/bindings/js/kjs_navigator.cpp \
        WebCore/bindings/js/kjs_proxy.cpp \
        WebCore/bindings/js/PausedTimeouts.cpp \
        WebCore/bindings/js/ScheduledAction.cpp \
@@ -803,6 +820,7 @@ webcore_sources += \
        WebCore/page/InspectorController.cpp \
        WebCore/page/JavaScriptDebugServer.cpp \
        WebCore/page/MouseEventWithHitTestResults.cpp \
+       WebCore/page/Navigator.cpp \
        WebCore/page/Page.cpp \
        WebCore/page/PageGroup.cpp \
        WebCore/page/Screen.cpp \
@@ -864,6 +882,11 @@ webcore_sources += \
        WebCore/platform/Timer.cpp \
        WebCore/platform/text/UnicodeRange.cpp \
        WebCore/platform/Widget.cpp \
+       WebCore/plugins/MimeType.cpp \
+       WebCore/plugins/MimeTypeArray.cpp \
+       WebCore/plugins/Plugin.cpp \
+       WebCore/plugins/PluginArray.cpp \
+       WebCore/plugins/PluginData.cpp \
        WebCore/plugins/PluginDatabase.cpp \
        WebCore/plugins/PluginInfoStore.cpp \
        WebCore/plugins/PluginPackage.cpp \
@@ -2050,7 +2073,8 @@ vpath %.idl = \
     $(WebCore)/page \
     $(WebCore)/storage \
     $(WebCore)/svg \
-    $(WebCore)/xml
+    $(WebCore)/xml \
+    $(WebCore)/plugins
 
 DerivedSources/JS%.h: DerivedSources/JS%.cpp;
 
@@ -2070,6 +2094,5 @@ CLEANFILES += \
        JSDOMWindowBase.lut.h \
        JSRGBColor.lut.h \
        JSXMLHttpRequest.lut.h \
-       JSXSLTProcessor.lut.h \
-       kjs_navigator.lut.h
+       JSXSLTProcessor.lut.h
 
index a88f40bb511edef58306b4c59ebb64a746ab1cc2..48e7f8aeabbf69809b32a82ef01f305c4cf01369 100644 (file)
@@ -253,8 +253,7 @@ LUT_FILES += \
     bindings/js/JSLocation.cpp \
     bindings/js/JSRGBColor.cpp \
     bindings/js/JSXMLHttpRequest.cpp \
-    bindings/js/JSXSLTProcessor.cpp \
-    bindings/js/kjs_navigator.cpp
+    bindings/js/JSXSLTProcessor.cpp
 
 LUT_TABLE_FILES += \
     bindings/js/JSHTMLInputElementBase.cpp
@@ -385,6 +384,11 @@ IDL_BINDINGS += \
     page/DOMWindow.idl \
     page/History.idl \
     page/Screen.idl \
+    page/Navigator.idl \
+    plugins/Plugin.idl \
+    plugins/MimeType.idl \
+    plugins/PluginArray.idl \
+    plugins/MimeTypeArray.idl \
     xml/DOMParser.idl \
     xml/XMLHttpRequestException.idl \
     xml/XMLSerializer.idl
@@ -428,6 +432,7 @@ SOURCES += \
     bindings/js/JSLocation.cpp \
     bindings/js/JSNamedNodeMapCustom.cpp \
     bindings/js/JSNamedNodesCollection.cpp  \
+    bindings/js/JSNavigatorCustom.cpp  \
     bindings/js/JSNodeCustom.cpp \
     bindings/js/JSNodeFilterCondition.cpp \
     bindings/js/JSNodeFilterCustom.cpp \
@@ -439,10 +444,12 @@ SOURCES += \
     bindings/js/JSTreeWalkerCustom.cpp \
     bindings/js/JSXMLHttpRequest.cpp \
     bindings/js/JSXSLTProcessor.cpp \
+    bindings/js/JSPluginCustom.cpp \
+    bindings/js/JSPluginArrayCustom.cpp \
+    bindings/js/JSMimeTypeArrayCustom.cpp \
     bindings/js/kjs_binding.cpp \
     bindings/js/kjs_events.cpp \
     bindings/js/kjs_html.cpp \
-    bindings/js/kjs_navigator.cpp \
     bindings/js/kjs_proxy.cpp \
     bindings/js/PausedTimeouts.cpp \
     bindings/js/ScheduledAction.cpp \
@@ -732,6 +739,7 @@ SOURCES += \
     page/ContextMenuController.cpp \
     page/DOMSelection.cpp \
     page/DOMWindow.cpp \
+    page/Navigator.cpp \
     page/DragController.cpp \
     page/EventHandler.cpp \
     page/FocusController.cpp \
@@ -747,6 +755,11 @@ SOURCES += \
     page/Screen.cpp \
     page/Settings.cpp \
     page/WindowFeatures.cpp \
+    plugins/PluginData.cpp \
+    plugins/PluginArray.cpp \
+    plugins/Plugin.cpp \
+    plugins/MimeType.cpp \
+    plugins/MimeTypeArray.cpp \
     platform/Arena.cpp \
     platform/text/AtomicString.cpp \
     platform/text/Base64.cpp \
@@ -911,6 +924,7 @@ qt-port {
     $$PWD/../WebKit/qt/Api/qwebpage.h \
     $$PWD/../WebKit/qt/Api/qwebview.h \
     $$PWD/../WebKit/qt/Api/qwebhistoryinterface.h \
+    $$PWD/../WebKit/qt/Api/qwebpluginfactory.h \
     $$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
     $$PWD/platform/network/qt/QNetworkReplyHandler.h
 
@@ -976,6 +990,7 @@ qt-port {
     platform/text/qt/TextCodecQt.cpp \
     platform/qt/WheelEventQt.cpp \
     platform/qt/WidgetQt.cpp \
+    plugins/qt/PluginDataQt.cpp \
     ../WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
     ../WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
     ../WebKit/qt/WebCoreSupport/DragClientQt.cpp \
@@ -989,6 +1004,7 @@ qt-port {
     ../WebKit/qt/Api/qwebhistory.cpp \
     ../WebKit/qt/Api/qwebsettings.cpp \
     ../WebKit/qt/Api/qwebhistoryinterface.cpp \
+    ../WebKit/qt/Api/qwebpluginfactory.cpp
 
     unix: SOURCES += platform/qt/SystemTimeQt.cpp
     else: SOURCES += platform/win/SystemTimeWin.cpp
@@ -998,15 +1014,10 @@ qt-port {
         HEADERS += \
             $$PWD/../WebKit/qt/Api/qwebnetworkinterface.h \
             $$PWD/../WebKit/qt/Api/qwebnetworkinterface_p.h \
-            $$PWD/../WebKit/qt/Api/qwebobjectplugin.h \
-            $$PWD/../WebKit/qt/Api/qwebobjectplugin_p.h \
-            $$PWD/../WebKit/qt/Api/qwebobjectpluginconnector.h \
             $$PWD/../WebKit/qt/Api/qcookiejar.h
 
         SOURCES += \
             ../WebKit/qt/Api/qwebnetworkinterface.cpp \
-            ../WebKit/qt/Api/qwebobjectplugin.cpp \
-            ../WebKit/qt/Api/qwebobjectpluginconnector.cpp \
             ../WebKit/qt/Api/qcookiejar.cpp
 
      }
index 35ed00881a01fa46ed7f0f3628441984502ee4ed..532e9a12b3e64870919b269b287c6bcdfa3896ef 100644 (file)
                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMessageEvent.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSMimeType.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSMimeType.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSMimeTypeArray.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSMimeTypeArray.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMouseEvent.cpp"\r
                                >\r
                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSNamedNodeMap.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSNavigator.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSNavigator.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSNode.cpp"\r
                                >\r
                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSOverflowEvent.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSPlugin.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSPlugin.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSPluginArray.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSPluginArray.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSProcessingInstruction.cpp"\r
                                >\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\page\Page.cpp"\r
+                               RelativePath="..\page\Navigator.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\page\Page.h"\r
+                               RelativePath="..\page\Navigator.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\page\Page.cpp"\r
                                >\r
                        </File>\r
                        <File\r
                                        RelativePath="..\bindings\js\JSLocation.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\JSMimeTypeArrayCustom.cpp"\r
+                                       >\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\bindings\js\JSNamedNodeMapCustom.cpp"\r
                                        >\r
                                        RelativePath="..\bindings\js\JSNamedNodesCollection.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\JSNavigatorCustom.cpp"\r
+                                       >\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\bindings\js\JSNodeCustom.cpp"\r
                                        >\r
                                        RelativePath="..\bindings\js\JSRGBColor.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\JSPluginArrayCustom.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\JSPluginCustom.cpp"\r
+                                       >\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\bindings\js\JSSQLResultSetRowListCustom.cpp"\r
                                        >\r
                                        RelativePath="..\bindings\js\kjs_html.h"\r
                                        >\r
                                </File>\r
-                               <File\r
-                                       RelativePath="..\bindings\js\kjs_navigator.cpp"\r
-                                       >\r
-                               </File>\r
-                               <File\r
-                                       RelativePath="..\bindings\js\kjs_navigator.h"\r
-                                       >\r
-                               </File>\r
                                <File\r
                                        RelativePath="..\bindings\js\kjs_proxy.cpp"\r
                                        >\r
                <Filter\r
                        Name="plugins"\r
                        >\r
+                       <File\r
+                               RelativePath="..\plugins\MimeType.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\plugins\MimeType.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\plugins\MimeTypeArray.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\plugins\MimeTypeArray.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\plugins\npapi.cpp"\r
                                >\r
                                RelativePath="..\plugins\npfunctions.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\plugins\Plugin.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\plugins\Plugin.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\plugins\PluginArray.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\plugins\PluginArray.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\plugins\PluginData.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\plugins\PluginData.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\plugins\PluginDatabase.cpp"\r
                                >\r
                                        RelativePath="..\plugins\win\PluginDatabaseWin.cpp"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\plugins\win\PluginDataWin.cpp"\r
+                                       >\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\plugins\win\PluginPackageWin.cpp"\r
                                        >\r
index 9e5435879179212564b5f989e86cecbacadeeaf3..14ddee2a49ede1181e852ad4029b9b251a4cdb7b 100644 (file)
                65C97AF308EA908800ACD273 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C97AF208EA908800ACD273 /* config.h */; };
                65CBFEF90974F607001DAC25 /* FrameView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65CBFEF70974F607001DAC25 /* FrameView.cpp */; };
                65CBFEFA0974F607001DAC25 /* FrameView.h in Headers */ = {isa = PBXBuildFile; fileRef = 65CBFEF80974F607001DAC25 /* FrameView.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               65D1C1CA09932B22000CB324 /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D1C1C909932B22000CB324 /* Plugin.h */; };
                65DF31DA09D1C123000BE325 /* JSAttr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31D809D1C122000BE325 /* JSAttr.cpp */; };
                65DF31DB09D1C123000BE325 /* JSAttr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31D909D1C123000BE325 /* JSAttr.h */; };
                65DF31F309D1CC60000BE325 /* JSCharacterData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31DF09D1CC60000BE325 /* JSCharacterData.cpp */; };
                93B70D6A09EB0C7C009D8468 /* kjs_events.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4E09EB0C7C009D8468 /* kjs_events.h */; };
                93B70D6B09EB0C7C009D8468 /* kjs_html.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4F09EB0C7C009D8468 /* kjs_html.cpp */; };
                93B70D6C09EB0C7C009D8468 /* kjs_html.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5009EB0C7C009D8468 /* kjs_html.h */; };
-               93B70D6D09EB0C7C009D8468 /* kjs_navigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D5109EB0C7C009D8468 /* kjs_navigator.cpp */; };
-               93B70D6E09EB0C7C009D8468 /* kjs_navigator.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5209EB0C7C009D8468 /* kjs_navigator.h */; };
                93B70D6F09EB0C7C009D8468 /* kjs_proxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D5309EB0C7C009D8468 /* kjs_proxy.cpp */; };
                93B70D7009EB0C7C009D8468 /* kjs_proxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5409EB0C7C009D8468 /* kjs_proxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93B77A380ADD792500EA4B81 /* FrameLoaderTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A81872230977D3C0005826D9 /* NamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A81872180977D3C0005826D9 /* NamedNodeMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A81872240977D3C0005826D9 /* NameNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81872190977D3C0005826D9 /* NameNodeList.cpp */; };
                A81872250977D3C0005826D9 /* ChildNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A818721A0977D3C0005826D9 /* ChildNodeList.cpp */; };
-               A82398A809B3ACF500B60641 /* PlugInInfoStoreMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */; };
                A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8239DFE09B3CF8A00B60641 /* Logging.cpp */; };
                A8239E0109B3CF8A00B60641 /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = A8239DFF09B3CF8A00B60641 /* Logging.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A826E8AE0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */; };
                A8F46B810CB20A9D003A9670 /* DOMSVGStringList.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85D79AD20ACA17EB00F02FC5 /* DOMSVGStringList.h */; };
                A8F4FB940C169E7B002AFED5 /* SVGRenderSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A8F4FB930C169E7B002AFED5 /* SVGRenderSupport.h */; };
                A8F4FB960C169E85002AFED5 /* SVGRenderSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8F4FB950C169E85002AFED5 /* SVGRenderSupport.cpp */; };
+               A9C6E4E30D745E05006442E9 /* MimeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4E10D745E05006442E9 /* MimeType.cpp */; };
+               A9C6E4E40D745E05006442E9 /* MimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4E20D745E05006442E9 /* MimeType.h */; };
+               A9C6E4E70D745E18006442E9 /* MimeTypeArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4E50D745E18006442E9 /* MimeTypeArray.cpp */; };
+               A9C6E4E80D745E18006442E9 /* MimeTypeArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4E60D745E18006442E9 /* MimeTypeArray.h */; };
+               A9C6E4EB0D745E2B006442E9 /* Plugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4E90D745E2B006442E9 /* Plugin.cpp */; };
+               A9C6E4EC0D745E2B006442E9 /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4EA0D745E2B006442E9 /* Plugin.h */; };
+               A9C6E4EF0D745E38006442E9 /* PluginArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4ED0D745E38006442E9 /* PluginArray.cpp */; };
+               A9C6E4F00D745E38006442E9 /* PluginArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4EE0D745E38006442E9 /* PluginArray.h */; };
+               A9C6E4F30D745E48006442E9 /* PluginData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4F10D745E48006442E9 /* PluginData.cpp */; };
+               A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4F20D745E48006442E9 /* PluginData.h */; };
+               A9C6E4F60D745E61006442E9 /* PluginDataMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4F50D745E61006442E9 /* PluginDataMac.mm */; };
+               A9C6E5A50D746458006442E9 /* Navigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E5A30D746458006442E9 /* Navigator.cpp */; };
+               A9C6E5A60D746458006442E9 /* Navigator.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E5A40D746458006442E9 /* Navigator.h */; };
+               A9C6E6470D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E6460D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp */; };
+               A9C6E6490D7465D8006442E9 /* JSNavigatorCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E6480D7465D8006442E9 /* JSNavigatorCustom.cpp */; };
+               A9C6E64C0D7465E7006442E9 /* JSPluginArrayCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E64A0D7465E7006442E9 /* JSPluginArrayCustom.cpp */; };
+               A9C6E64D0D7465E7006442E9 /* JSPluginCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E64B0D7465E7006442E9 /* JSPluginCustom.cpp */; };
+               A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D247F50D757E3300FDF959 /* JSNavigator.cpp */; };
+               A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D247F60D757E3300FDF959 /* JSNavigator.h */; };
+               A9D247FE0D757E6900FDF959 /* JSPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D247FA0D757E6900FDF959 /* JSPlugin.cpp */; };
+               A9D247FF0D757E6900FDF959 /* JSPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D247FB0D757E6900FDF959 /* JSPlugin.h */; };
+               A9D248000D757E6900FDF959 /* JSPluginArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D247FC0D757E6900FDF959 /* JSPluginArray.cpp */; };
+               A9D248010D757E6900FDF959 /* JSPluginArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D247FD0D757E6900FDF959 /* JSPluginArray.h */; };
+               A9D248060D757E7D00FDF959 /* JSMimeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D248020D757E7D00FDF959 /* JSMimeType.cpp */; };
+               A9D248070D757E7D00FDF959 /* JSMimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D248030D757E7D00FDF959 /* JSMimeType.h */; };
+               A9D248080D757E7D00FDF959 /* JSMimeTypeArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D248040D757E7D00FDF959 /* JSMimeTypeArray.cpp */; };
+               A9D248090D757E7D00FDF959 /* JSMimeTypeArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D248050D757E7D00FDF959 /* JSMimeTypeArray.h */; };
                AA0972CC0B6947A800A705E9 /* SVGInlineTextBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0972CA0B6947A800A705E9 /* SVGInlineTextBox.cpp */; };
                AA0972CD0B6947A800A705E9 /* SVGInlineTextBox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0972CB0B6947A800A705E9 /* SVGInlineTextBox.h */; };
                AA21ECCA0ABF0FBA002B834C /* CSSCursorImageValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */; };
                65C97AF208EA908800ACD273 /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
                65CBFEF70974F607001DAC25 /* FrameView.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FrameView.cpp; sourceTree = "<group>"; };
                65CBFEF80974F607001DAC25 /* FrameView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameView.h; sourceTree = "<group>"; };
-               65D1C1C909932B22000CB324 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = "<group>"; };
                65DF31D809D1C122000BE325 /* JSAttr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSAttr.cpp; sourceTree = "<group>"; };
                65DF31D909D1C123000BE325 /* JSAttr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSAttr.h; sourceTree = "<group>"; };
                65DF31DF09D1CC60000BE325 /* JSCharacterData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCharacterData.cpp; sourceTree = "<group>"; };
                93B70D4E09EB0C7C009D8468 /* kjs_events.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_events.h; sourceTree = "<group>"; };
                93B70D4F09EB0C7C009D8468 /* kjs_html.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_html.cpp; sourceTree = "<group>"; };
                93B70D5009EB0C7C009D8468 /* kjs_html.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_html.h; sourceTree = "<group>"; };
-               93B70D5109EB0C7C009D8468 /* kjs_navigator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_navigator.cpp; sourceTree = "<group>"; };
-               93B70D5209EB0C7C009D8468 /* kjs_navigator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_navigator.h; sourceTree = "<group>"; };
                93B70D5309EB0C7C009D8468 /* kjs_proxy.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_proxy.cpp; sourceTree = "<group>"; };
                93B70D5409EB0C7C009D8468 /* kjs_proxy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_proxy.h; sourceTree = "<group>"; };
                93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameLoaderTypes.h; sourceTree = "<group>"; };
                A81872180977D3C0005826D9 /* NamedNodeMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NamedNodeMap.h; sourceTree = "<group>"; };
                A81872190977D3C0005826D9 /* NameNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = NameNodeList.cpp; sourceTree = "<group>"; };
                A818721A0977D3C0005826D9 /* ChildNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ChildNodeList.cpp; sourceTree = "<group>"; };
-               A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = PlugInInfoStoreMac.mm; sourceTree = "<group>"; };
                A8239DFE09B3CF8A00B60641 /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Logging.cpp; sourceTree = "<group>"; };
                A8239DFF09B3CF8A00B60641 /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; };
                A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptionElementConstructor.h; sourceTree = "<group>"; };
                A8EA80060A19516E00A8EF5F /* MediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaList.h; sourceTree = "<group>"; };
                A8F4FB930C169E7B002AFED5 /* SVGRenderSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRenderSupport.h; sourceTree = "<group>"; };
                A8F4FB950C169E85002AFED5 /* SVGRenderSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGRenderSupport.cpp; sourceTree = "<group>"; };
+               A9C6E4E10D745E05006442E9 /* MimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MimeType.cpp; sourceTree = "<group>"; };
+               A9C6E4E20D745E05006442E9 /* MimeType.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MimeType.h; sourceTree = "<group>"; };
+               A9C6E4E50D745E18006442E9 /* MimeTypeArray.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MimeTypeArray.cpp; sourceTree = "<group>"; };
+               A9C6E4E60D745E18006442E9 /* MimeTypeArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MimeTypeArray.h; sourceTree = "<group>"; };
+               A9C6E4E90D745E2B006442E9 /* Plugin.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Plugin.cpp; sourceTree = "<group>"; };
+               A9C6E4EA0D745E2B006442E9 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = "<group>"; };
+               A9C6E4ED0D745E38006442E9 /* PluginArray.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PluginArray.cpp; sourceTree = "<group>"; };
+               A9C6E4EE0D745E38006442E9 /* PluginArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginArray.h; sourceTree = "<group>"; };
+               A9C6E4F10D745E48006442E9 /* PluginData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PluginData.cpp; sourceTree = "<group>"; };
+               A9C6E4F20D745E48006442E9 /* PluginData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginData.h; sourceTree = "<group>"; };
+               A9C6E4F50D745E61006442E9 /* PluginDataMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = PluginDataMac.mm; path = mac/PluginDataMac.mm; sourceTree = "<group>"; };
+               A9C6E5A30D746458006442E9 /* Navigator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Navigator.cpp; sourceTree = "<group>"; };
+               A9C6E5A40D746458006442E9 /* Navigator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Navigator.h; sourceTree = "<group>"; };
+               A9C6E6460D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMimeTypeArrayCustom.cpp; sourceTree = "<group>"; };
+               A9C6E6480D7465D8006442E9 /* JSNavigatorCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorCustom.cpp; sourceTree = "<group>"; };
+               A9C6E64A0D7465E7006442E9 /* JSPluginArrayCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSPluginArrayCustom.cpp; sourceTree = "<group>"; };
+               A9C6E64B0D7465E7006442E9 /* JSPluginCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSPluginCustom.cpp; sourceTree = "<group>"; };
+               A9C6E65D0D746694006442E9 /* Navigator.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Navigator.idl; sourceTree = "<group>"; };
+               A9C6E65E0D7466F2006442E9 /* MimeType.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = MimeType.idl; sourceTree = "<group>"; };
+               A9C6E65F0D746700006442E9 /* MimeTypeArray.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = MimeTypeArray.idl; sourceTree = "<group>"; };
+               A9C6E6600D74670C006442E9 /* Plugin.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Plugin.idl; sourceTree = "<group>"; };
+               A9C6E6610D74671E006442E9 /* PluginArray.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = PluginArray.idl; sourceTree = "<group>"; };
+               A9D247F50D757E3300FDF959 /* JSNavigator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigator.cpp; sourceTree = "<group>"; };
+               A9D247F60D757E3300FDF959 /* JSNavigator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNavigator.h; sourceTree = "<group>"; };
+               A9D247FA0D757E6900FDF959 /* JSPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSPlugin.cpp; sourceTree = "<group>"; };
+               A9D247FB0D757E6900FDF959 /* JSPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSPlugin.h; sourceTree = "<group>"; };
+               A9D247FC0D757E6900FDF959 /* JSPluginArray.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSPluginArray.cpp; sourceTree = "<group>"; };
+               A9D247FD0D757E6900FDF959 /* JSPluginArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSPluginArray.h; sourceTree = "<group>"; };
+               A9D248020D757E7D00FDF959 /* JSMimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMimeType.cpp; sourceTree = "<group>"; };
+               A9D248030D757E7D00FDF959 /* JSMimeType.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSMimeType.h; sourceTree = "<group>"; };
+               A9D248040D757E7D00FDF959 /* JSMimeTypeArray.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMimeTypeArray.cpp; sourceTree = "<group>"; };
+               A9D248050D757E7D00FDF959 /* JSMimeTypeArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSMimeTypeArray.h; sourceTree = "<group>"; };
                AA0972CA0B6947A800A705E9 /* SVGInlineTextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGInlineTextBox.cpp; sourceTree = "<group>"; };
                AA0972CB0B6947A800A705E9 /* SVGInlineTextBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGInlineTextBox.h; sourceTree = "<group>"; };
                AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCursorImageValue.cpp; sourceTree = "<group>"; };
                                BC9854430CD3D9D000069BC1 /* Window */,
                                A83B79220CCB00F0000B0825 /* XML */,
                                A83B790C0CCAFF83000B0825 /* XPath */,
+                               A9D247F90D757E4100FDF959 /* Plugins */,
                        );
                        name = "Derived Sources";
                        path = DerivedSources/WebCore;
                5DCF83690D59157800953BC6 /* plugins */ = {
                        isa = PBXGroup;
                        children = (
+                               A9C6E6610D74671E006442E9 /* PluginArray.idl */,
+                               A9C6E6600D74670C006442E9 /* Plugin.idl */,
+                               A9C6E65F0D746700006442E9 /* MimeTypeArray.idl */,
+                               A9C6E65E0D7466F2006442E9 /* MimeType.idl */,
+                               A9C6E4F50D745E61006442E9 /* PluginDataMac.mm */,
+                               A9C6E4F10D745E48006442E9 /* PluginData.cpp */,
+                               A9C6E4F20D745E48006442E9 /* PluginData.h */,
+                               A9C6E4ED0D745E38006442E9 /* PluginArray.cpp */,
+                               A9C6E4EE0D745E38006442E9 /* PluginArray.h */,
+                               A9C6E4E90D745E2B006442E9 /* Plugin.cpp */,
+                               A9C6E4EA0D745E2B006442E9 /* Plugin.h */,
+                               A9C6E4E50D745E18006442E9 /* MimeTypeArray.cpp */,
+                               A9C6E4E60D745E18006442E9 /* MimeTypeArray.h */,
+                               A9C6E4E10D745E05006442E9 /* MimeType.cpp */,
+                               A9C6E4E20D745E05006442E9 /* MimeType.h */,
                                5DCF836C0D59159800953BC6 /* PluginInfoStore.h */,
                        );
                        path = plugins;
                                BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */,
                                BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */,
                                BC7B2AF90450824100A8000F /* PlatformScrollBarMac.mm */,
-                               A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */,
                                0668E18E0ADD9640004128E0 /* PopupMenuMac.mm */,
                                1CE24F960D7CAF0E007E04C2 /* SchedulePairMac.mm */,
                                BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */,
                65BF02180974806300C43196 /* page */ = {
                        isa = PBXGroup;
                        children = (
+                               A9C6E65D0D746694006442E9 /* Navigator.idl */,
+                               A9C6E5A30D746458006442E9 /* Navigator.cpp */,
+                               A9C6E5A40D746458006442E9 /* Navigator.h */,
                                06693F450BFBC91600216072 /* inspector */,
                                93C09A820B064F05005ABD4D /* mac */,
                                8538F0000AD71770006A81D1 /* AbstractView.idl */,
                        name = XML;
                        sourceTree = "<group>";
                };
+               A9D247F90D757E4100FDF959 /* Plugins */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A9D248020D757E7D00FDF959 /* JSMimeType.cpp */,
+                               A9D248030D757E7D00FDF959 /* JSMimeType.h */,
+                               A9D248040D757E7D00FDF959 /* JSMimeTypeArray.cpp */,
+                               A9D248050D757E7D00FDF959 /* JSMimeTypeArray.h */,
+                               A9D247FA0D757E6900FDF959 /* JSPlugin.cpp */,
+                               A9D247FB0D757E6900FDF959 /* JSPlugin.h */,
+                               A9D247FC0D757E6900FDF959 /* JSPluginArray.cpp */,
+                               A9D247FD0D757E6900FDF959 /* JSPluginArray.h */,
+                       );
+                       name = Plugins;
+                       sourceTree = "<group>";
+               };
                B22277CA0D00BF1E0071B782 /* svg */ = {
                        isa = PBXGroup;
                        children = (
                                93B70D4E09EB0C7C009D8468 /* kjs_events.h */,
                                93B70D4F09EB0C7C009D8468 /* kjs_html.cpp */,
                                93B70D5009EB0C7C009D8468 /* kjs_html.h */,
-                               93B70D5109EB0C7C009D8468 /* kjs_navigator.cpp */,
-                               93B70D5209EB0C7C009D8468 /* kjs_navigator.h */,
                                93B70D5309EB0C7C009D8468 /* kjs_proxy.cpp */,
                                93B70D5409EB0C7C009D8468 /* kjs_proxy.h */,
                                BCA378140D15C64600B793D6 /* PausedTimeouts.cpp */,
                BC4EDEF70C08F414007EDD49 /* Custom */ = {
                        isa = PBXGroup;
                        children = (
+                               A9C6E64A0D7465E7006442E9 /* JSPluginArrayCustom.cpp */,
+                               A9C6E64B0D7465E7006442E9 /* JSPluginCustom.cpp */,
+                               A9C6E6480D7465D8006442E9 /* JSNavigatorCustom.cpp */,
+                               A9C6E6460D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp */,
+                               A766F3520D6BDE3500ABDDB3 /* JSCanvasPixelArrayCustom.cpp */,
                                BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
                                A766F3520D6BDE3500ABDDB3 /* JSCanvasPixelArrayCustom.cpp */,
                                1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */,
                                BC124EFE0C26447A009E2349 /* JSBarInfo.h */,
                                BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */,
                                BC98543C0CD3D98B00069BC1 /* JSConsole.h */,
+                               A9D247F50D757E3300FDF959 /* JSNavigator.cpp */,
+                               A9D247F60D757E3300FDF959 /* JSNavigator.h */,
                                BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */,
                                BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */,
                                1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */,
                                BC3FCAA90AC3DB5800BA54AD /* PlatformScrollBar.h in Headers */,
                                B2C3DA2B0D006C1D00EF6F26 /* PlatformString.h in Headers */,
                                935C476B09AC4D4F00A6AAB4 /* PlatformWheelEvent.h in Headers */,
-                               65D1C1CA09932B22000CB324 /* Plugin.h in Headers */,
                                1AC694C80A3B1676003F5049 /* PluginDocument.h in Headers */,
                                B2B1F7170D00CAA8004AEA64 /* PointerEventsHitRules.h in Headers */,
                                0668E18B0ADD9624004128E0 /* PopupMenu.h in Headers */,
                                93B70D6409EB0C7C009D8468 /* kjs_binding.h in Headers */,
                                93B70D6A09EB0C7C009D8468 /* kjs_events.h in Headers */,
                                93B70D6C09EB0C7C009D8468 /* kjs_html.h in Headers */,
-                               93B70D6E09EB0C7C009D8468 /* kjs_navigator.h in Headers */,
                                656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */,
                                93B70D7009EB0C7C009D8468 /* kjs_proxy.h in Headers */,
                                BCB16C2D0979C3BD00467741 /* loader.h in Headers */,
                                BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
                                C02B14C20D81E02A00D8A970 /* JavaScriptDebugListener.h in Headers */,
                                C02B14C40D81E02A00D8A970 /* JavaScriptDebugServer.h in Headers */,
+                               A9C6E4E40D745E05006442E9 /* MimeType.h in Headers */,
+                               A9C6E4E80D745E18006442E9 /* MimeTypeArray.h in Headers */,
+                               A9C6E4EC0D745E2B006442E9 /* Plugin.h in Headers */,
+                               A9C6E4F00D745E38006442E9 /* PluginArray.h in Headers */,
+                               A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */,
+                               A9C6E5A60D746458006442E9 /* Navigator.h in Headers */,
+                               A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */,
+                               A9D247FF0D757E6900FDF959 /* JSPlugin.h in Headers */,
+                               A9D248010D757E6900FDF959 /* JSPluginArray.h in Headers */,
+                               A9D248070D757E7D00FDF959 /* JSMimeType.h in Headers */,
+                               A9D248090D757E7D00FDF959 /* JSMimeTypeArray.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                935C477109AC4D7300A6AAB4 /* PlatformMouseEventMac.mm in Sources */,
                                BC94D1080C274F88006BC617 /* PlatformScreenMac.mm in Sources */,
                                93F19ADC08245E59001E9ABC /* PlatformScrollBarMac.mm in Sources */,
-                               A82398A809B3ACF500B60641 /* PlugInInfoStoreMac.mm in Sources */,
                                1AC694C70A3B1676003F5049 /* PluginDocument.cpp in Sources */,
                                B2B1F7160D00CAA8004AEA64 /* PointerEventsHitRules.cpp in Sources */,
                                0668E1900ADD9640004128E0 /* PopupMenuMac.mm in Sources */,
                                93B70D6309EB0C7C009D8468 /* kjs_binding.cpp in Sources */,
                                93B70D6909EB0C7C009D8468 /* kjs_events.cpp in Sources */,
                                93B70D6B09EB0C7C009D8468 /* kjs_html.cpp in Sources */,
-                               93B70D6D09EB0C7C009D8468 /* kjs_navigator.cpp in Sources */,
                                93B70D6F09EB0C7C009D8468 /* kjs_proxy.cpp in Sources */,
                                BCB16C2C0979C3BD00467741 /* loader.cpp in Sources */,
                                93309DF7099E64920056E581 /* markup.cpp in Sources */,
                                1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */,
                                BC6932730D7E293900AE44D1 /* JSDOMWindowBase.cpp in Sources */,
                                C02B14C30D81E02A00D8A970 /* JavaScriptDebugServer.cpp in Sources */,
+                               A9C6E4E30D745E05006442E9 /* MimeType.cpp in Sources */,
+                               A9C6E4E70D745E18006442E9 /* MimeTypeArray.cpp in Sources */,
+                               A9C6E4EB0D745E2B006442E9 /* Plugin.cpp in Sources */,
+                               A9C6E4EF0D745E38006442E9 /* PluginArray.cpp in Sources */,
+                               A9C6E4F30D745E48006442E9 /* PluginData.cpp in Sources */,
+                               A9C6E4F60D745E61006442E9 /* PluginDataMac.mm in Sources */,
+                               A9C6E5A50D746458006442E9 /* Navigator.cpp in Sources */,
+                               A9C6E6470D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp in Sources */,
+                               A9C6E6490D7465D8006442E9 /* JSNavigatorCustom.cpp in Sources */,
+                               A9C6E64C0D7465E7006442E9 /* JSPluginArrayCustom.cpp in Sources */,
+                               A9C6E64D0D7465E7006442E9 /* JSPluginCustom.cpp in Sources */,
+                               A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
+                               A9D247FE0D757E6900FDF959 /* JSPlugin.cpp in Sources */,
+                               A9D248000D757E6900FDF959 /* JSPluginArray.cpp in Sources */,
+                               A9D248060D757E7D00FDF959 /* JSMimeType.cpp in Sources */,
+                               A9D248080D757E7D00FDF959 /* JSMimeTypeArray.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 0b301f9dd2c5b370d532c2175785743adfc84025..a78292e7113d104cda1b2930ccdd5693b55ed42d 100644 (file)
@@ -60,7 +60,6 @@
 #include "WindowFeatures.h"
 #include "htmlediting.h"
 #include "kjs_events.h"
-#include "kjs_navigator.h"
 #include "kjs_proxy.h"
 #include <wtf/AlwaysInline.h>
 #include <wtf/MathExtras.h>
@@ -161,8 +160,6 @@ const ClassInfo JSDOMWindowBase::info = { "Window", 0, &JSDOMWindowBaseTable };
   crypto                WebCore::JSDOMWindowBase::Crypto             DontDelete|ReadOnly
   event                 WebCore::JSDOMWindowBase::Event_             DontDelete
   location              WebCore::JSDOMWindowBase::Location_          DontDelete
-  navigator             WebCore::JSDOMWindowBase::Navigator_         DontDelete
-  clientInformation     WebCore::JSDOMWindowBase::ClientInformation  DontDelete
 # -- Event Listeners --
   onabort               WebCore::JSDOMWindowBase::Onabort            DontDelete
   onblur                WebCore::JSDOMWindowBase::Onblur             DontDelete
@@ -453,18 +450,6 @@ JSValue *JSDOMWindowBase::getValueProperty(ExecState *exec, int token) const
       return toJS(exec, d->m_evt);
     case Location_:
       return location();
-    case Navigator_:
-    case ClientInformation: {
-      if (!allowsAccessFrom(exec))
-        return jsUndefined();
-      // Store the navigator in the object so we get the same one each time.
-      Navigator* n = new Navigator(exec->lexicalGlobalObject()->objectPrototype(), impl()->frame());
-      // FIXME: this will make the "navigator" object accessible from windows that fail
-      // the security check the first time, but not subsequent times, seems weird.
-      const_cast<JSDOMWindowBase*>(this)->putDirect("navigator", n, DontDelete);
-      const_cast<JSDOMWindowBase*>(this)->putDirect("clientInformation", n, DontDelete);
-      return n;
-    }
     case Image:
       if (!allowsAccessFrom(exec))
         return jsUndefined();
diff --git a/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp b/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp
new file mode 100644 (file)
index 0000000..7da3882
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "JSMimeTypeArray.h"
+
+#include "AtomicString.h"
+#include "MimeTypeArray.h"
+
+namespace WebCore {
+
+using namespace KJS;
+
+bool JSMimeTypeArray::canGetItemsForName(ExecState*, MimeTypeArray* mimeTypeArray, const Identifier& propertyName)
+{
+    return mimeTypeArray->canGetItemsForName(propertyName);
+}
+
+JSValue* JSMimeTypeArray::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
+{
+    JSMimeTypeArray* thisObj = static_cast<JSMimeTypeArray*>(slot.slotBase());
+    return toJS(exec, thisObj->impl()->nameGetter(propertyName));
+}
+
+}
diff --git a/WebCore/bindings/js/JSNavigatorCustom.cpp b/WebCore/bindings/js/JSNavigatorCustom.cpp
new file mode 100644 (file)
index 0000000..ce59257
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ *  Copyright (C) 2000 Harri Porten (porten@kde.org)
+ *  Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org)
+ *  Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All Rights Reserved.
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "JSNavigator.h"
+
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "KURL.h"
+#include "Navigator.h"
+#include "Settings.h"
+
+namespace WebCore {
+
+using namespace KJS;
+
+static bool needsYouTubeQuirk(ExecState*, Frame*);
+
+#if !PLATFORM(WIN)
+
+static inline bool needsYouTubeQuirk(ExecState*, Frame*)
+{
+    return false;
+}
+
+#else
+
+static bool needsYouTubeQuirk(ExecState* exec, Frame* frame)
+{
+    // This quirk works around a mistaken check in an ad at youtube.com.
+    // There's a function called isSafari that returns false if the function
+    // called isWindows returns true; thus the site malfunctions with Windows Safari.
+
+    // Do the quirk only if the function's name is "isWindows".
+    FunctionImp* function = exec->function();
+    if (!function)
+        return false;
+    static const Identifier& isWindowsFunctionName = *new Identifier("isWindows");
+    if (function->functionName() != isWindowsFunctionName)
+        return false;
+
+    // Do the quirk only if the function is called by an "isSafari" function.
+    // However, that function is not itself named -- it is stored in the isSafari
+    // property, though, so that's how we recognize it.
+    ExecState* callingExec = exec->callingExecState();
+    if (!callingExec)
+        return false;
+    FunctionImp* callingFunction = callingExec->function();
+    if (!callingFunction)
+        return false;
+    JSObject* thisObject = callingExec->thisValue();
+    if (!thisObject)
+        return false;
+    static const Identifier& isSafariFunctionName = *new Identifier("isSafari");
+    JSValue* isSafariFunction = thisObject->getDirect(isSafariFunctionName);
+    if (isSafariFunction != callingFunction)
+        return false;
+
+    Document* document = frame->document();
+    // FIXME: The document is never null, so we should remove this check along with the
+    // other similar ones in this file when we are absolutely sure it's safe.
+    if (!document)
+        return false;
+
+    // Do the quirk only on the front page of the global version of YouTube.
+    const KURL& url = document->url();
+    if (url.host() != "youtube.com" && url.host() != "www.youtube.com")
+        return false;
+    if (url.path() != "/")
+        return false;
+
+    // As with other site-specific quirks, allow website developers to turn this off.
+    // In theory, this allows website developers to check if their fixes are effective.
+    Settings* settings = frame->settings();
+    if (!settings)
+        return false;
+    if (!settings->needsSiteSpecificQuirks())
+        return false;
+
+    return true;
+}
+
+#endif
+
+JSValue* JSNavigator::appVersion(ExecState* exec) const
+{
+    Navigator* imp = static_cast<Navigator*>(impl());
+    Frame* frame = imp->frame();
+    if (!frame)
+        return jsString("");
+
+    if (needsYouTubeQuirk(exec, frame))
+        return jsString("");
+    return jsString(imp->appVersion());
+}
+
+}
diff --git a/WebCore/bindings/js/JSPluginArrayCustom.cpp b/WebCore/bindings/js/JSPluginArrayCustom.cpp
new file mode 100644 (file)
index 0000000..d7ae4d3
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "JSPluginArray.h"
+
+#include "AtomicString.h"
+#include "PluginArray.h"
+
+namespace WebCore {
+
+using namespace KJS;
+
+bool JSPluginArray::canGetItemsForName(ExecState*, PluginArray* pluginArray, const Identifier& propertyName)
+{
+    return pluginArray->canGetItemsForName(propertyName);
+}
+
+JSValue* JSPluginArray::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
+{
+    JSPluginArray* thisObj = static_cast<JSPluginArray*>(slot.slotBase());
+    return toJS(exec, thisObj->impl()->nameGetter(propertyName));
+}
+
+}
diff --git a/WebCore/bindings/js/JSPluginCustom.cpp b/WebCore/bindings/js/JSPluginCustom.cpp
new file mode 100644 (file)
index 0000000..e7079d9
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "JSPlugin.h"
+
+#include "AtomicString.h"
+#include "Plugin.h"
+
+namespace WebCore {
+
+using namespace KJS;
+
+bool JSPlugin::canGetItemsForName(ExecState*, Plugin* plugin, const Identifier& propertyName)
+{
+    return plugin->canGetItemsForName(propertyName);
+}
+
+JSValue* JSPlugin::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
+{
+    JSPlugin* thisObj = static_cast<JSPlugin*>(slot.slotBase());
+    return toJS(exec, thisObj->impl()->nameGetter(propertyName));
+}
+
+}
diff --git a/WebCore/bindings/js/kjs_navigator.cpp b/WebCore/bindings/js/kjs_navigator.cpp
deleted file mode 100644 (file)
index eb1a872..0000000
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- *  Copyright (C) 2000 Harri Porten (porten@kde.org)
- *  Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org)
- *  Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org)
- *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All Rights Reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "kjs_navigator.h"
-
-#include "AtomicString.h"
-#include "CookieJar.h"
-#include "DOMWindow.h"
-#include "Document.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "JSDOMWindow.h"
-#include "Language.h"
-#include "Page.h"
-#include "PluginInfoStore.h"
-#include "Settings.h"
-#include <kjs/object_object.h>
-
-#ifndef WEBCORE_NAVIGATOR_PLATFORM
-#if PLATFORM(MAC) && PLATFORM(PPC)
-#define WEBCORE_NAVIGATOR_PLATFORM "MacPPC"
-#elif PLATFORM(MAC) && PLATFORM(X86)
-#define WEBCORE_NAVIGATOR_PLATFORM "MacIntel"
-#elif PLATFORM(WIN_OS)
-#define WEBCORE_NAVIGATOR_PLATFORM "Win32"
-#else
-#define WEBCORE_NAVIGATOR_PLATFORM ""
-#endif
-#endif // ifndef WEBCORE_NAVIGATOR_PLATFORM
-
-#ifndef WEBCORE_NAVIGATOR_PRODUCT
-#define WEBCORE_NAVIGATOR_PRODUCT "Gecko"
-#endif // ifndef WEBCORE_NAVIGATOR_PRODUCT
-
-#ifndef WEBCORE_NAVIGATOR_PRODUCT_SUB
-#define WEBCORE_NAVIGATOR_PRODUCT_SUB "20030107"
-#endif // ifndef WEBCORE_NAVIGATOR_PRODUCT_SUB
-
-#ifndef WEBCORE_NAVIGATOR_VENDOR
-#define WEBCORE_NAVIGATOR_VENDOR "Apple Computer, Inc."
-#endif // ifndef WEBCORE_NAVIGATOR_VENDOR
-
-#ifndef WEBCORE_NAVIGATOR_VENDOR_SUB
-#define WEBCORE_NAVIGATOR_VENDOR_SUB ""
-#endif // ifndef WEBCORE_NAVIGATOR_VENDOR_SUB
-
-using namespace KJS;
-using namespace WebCore;
-
-namespace WebCore {
-
-    class PluginBase : public DOMObject {
-    public:
-        PluginBase(ExecState*);
-        virtual ~PluginBase();
-        
-        static void refresh(bool reload);
-
-    protected:
-        static void cachePluginDataIfNecessary();
-        static Vector<PluginInfo*>* plugins;
-        static Vector<MimeClassInfo*>* mimes;
-
-    private:
-        static int m_plugInCacheRefCount;
-    };
-
-
-    class Plugins : public PluginBase {
-    public:
-        Plugins(ExecState* exec) : PluginBase(exec) { }
-        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-        JSValue* getValueProperty(ExecState*, int token) const;
-        virtual const ClassInfo* classInfo() const { return &info; }
-        static const ClassInfo info;
-        enum { Length };
-    private:
-        static JSValue* indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-        static JSValue* nameGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-    };
-
-    JSValue* pluginsFunctionRefresh(ExecState*, JSObject*, const List&);
-
-    class MimeTypes : public PluginBase {
-    public:
-        MimeTypes(ExecState* exec) : PluginBase(exec) { };
-        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-        JSValue* getValueProperty(ExecState*, int token) const;
-        virtual const ClassInfo* classInfo() const { return &info; }
-        static const ClassInfo info;
-        enum { Length };
-    private:
-        static JSValue* indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-        static JSValue* nameGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-    };
-
-    class Plugin : public PluginBase {
-    public:
-        Plugin(ExecState* exec, PluginInfo* info) : PluginBase(exec), m_info(info) { }
-        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-        JSValue* getValueProperty(ExecState*, int token) const;
-        virtual const ClassInfo* classInfo() const { return &info; }
-        static const ClassInfo info;
-        enum { Name, Filename, Description, Length };
-    private:
-        static JSValue* indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-        static JSValue* nameGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
-
-        PluginInfo* m_info;
-    };
-
-    class MimeType : public PluginBase {
-    public:
-        MimeType(ExecState* exec, MimeClassInfo* info) : PluginBase(exec), m_info(info) { }
-        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-        JSValue* getValueProperty(ExecState*, int token) const;
-        virtual const ClassInfo* classInfo() const { return &info; }
-        static const ClassInfo info;
-        enum { Type, Suffixes, Description, EnabledPlugin };
-    private:
-        MimeClassInfo* m_info;
-    };
-
-}
-
-#include "kjs_navigator.lut.h"
-
-namespace WebCore {
-
-const ClassInfo Plugins::info = { "PluginArray", 0, &PluginsTable };
-const ClassInfo MimeTypes::info = { "MimeTypeArray", 0, &MimeTypesTable };
-const ClassInfo Plugin::info = { "Plugin", 0, &PluginTable };
-const ClassInfo MimeType::info = { "MimeType", 0, &MimeTypeTable };
-
-Vector<PluginInfo*>* PluginBase::plugins = 0;
-Vector<MimeClassInfo*>* PluginBase::mimes = 0;
-int PluginBase::m_plugInCacheRefCount = 0;
-
-const ClassInfo Navigator::info = { "Navigator", 0, &NavigatorTable };
-/*
-@begin NavigatorTable 13
-  appCodeName   Navigator::AppCodeName                  DontDelete|ReadOnly
-  appName       Navigator::AppName                      DontDelete|ReadOnly
-  appVersion    Navigator::AppVersion                   DontDelete|ReadOnly
-  language      Navigator::Language                     DontDelete|ReadOnly
-  userAgent     Navigator::UserAgent                    DontDelete|ReadOnly
-  platform      Navigator::Platform                     DontDelete|ReadOnly
-  plugins       Navigator::_Plugins                     DontDelete|ReadOnly
-  mimeTypes     Navigator::_MimeTypes                   DontDelete|ReadOnly
-  product       Navigator::Product                      DontDelete|ReadOnly
-  productSub    Navigator::ProductSub                   DontDelete|ReadOnly
-  vendor        Navigator::Vendor                       DontDelete|ReadOnly
-  vendorSub     Navigator::VendorSub                    DontDelete|ReadOnly
-  cookieEnabled Navigator::CookieEnabled                DontDelete|ReadOnly
-  javaEnabled   navigatorProtoFuncJavaEnabled  DontDelete|Function 0
-@end
-*/
-
-Navigator::Navigator(JSObject* prototype, Frame* frame)
-    : DOMObject(prototype)
-    , m_frame(frame)
-{
-}
-
-bool Navigator::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
-  return getStaticPropertySlot<Navigator, JSObject>(exec, &NavigatorTable, this, propertyName, slot);
-}
-
-static bool needsYouTubeQuirk(ExecState*, Frame*);
-
-#if !PLATFORM(WIN)
-
-static inline bool needsYouTubeQuirk(ExecState*, Frame*)
-{
-    return false;
-}
-
-#else
-
-static bool needsYouTubeQuirk(ExecState* exec, Frame* frame)
-{
-    // This quirk works around a mistaken check in an ad at youtube.com.
-    // There's a function called isSafari that returns false if the function
-    // called isWindows returns true; thus the site malfunctions with Windows Safari.
-
-    // Do the quirk only if the function's name is "isWindows".
-    FunctionImp* function = exec->function();
-    if (!function)
-        return false;
-    static const Identifier& isWindowsFunctionName = *new Identifier("isWindows");
-    if (function->functionName() != isWindowsFunctionName)
-        return false;
-
-    // Do the quirk only if the function is called by an "isSafari" function.
-    // However, that function is not itself named -- it is stored in the isSafari
-    // property, though, so that's how we recognize it.
-    ExecState* callingExec = exec->callingExecState();
-    if (!callingExec)
-        return false;
-    FunctionImp* callingFunction = callingExec->function();
-    if (!callingFunction)
-        return false;
-    JSObject* thisObject = callingExec->thisValue();
-    if (!thisObject)
-        return false;
-    static const Identifier& isSafariFunctionName = *new Identifier("isSafari");
-    JSValue* isSafariFunction = thisObject->getDirect(isSafariFunctionName);
-    if (isSafariFunction != callingFunction)
-        return false;
-
-    Document* document = frame->document(); 
-    // FIXME: The document is never null, so we should remove this check along with the
-    // other similar ones in this file when we are absolutely sure it's safe.
-    if (!document)
-        return false;
-
-    // Do the quirk only on the front page of the global version of YouTube.
-    const KURL& url = document->url();
-    if (url.host() != "youtube.com" && url.host() != "www.youtube.com")
-        return false;
-    if (url.path() != "/")
-        return false;
-
-    // As with other site-specific quirks, allow website developers to turn this off.
-    // In theory, this allows website developers to check if their fixes are effective.
-    Settings* settings = frame->settings(); 
-    if (!settings)
-        return false;
-    if (!settings->needsSiteSpecificQuirks())
-        return false;
-
-    return true;
-}
-
-#endif
-
-JSValue* Navigator::getValueProperty(ExecState* exec, int token) const
-{
-  switch (token) {
-  case AppCodeName:
-    return jsString("Mozilla");
-  case AppName:
-    return jsString("Netscape");
-  case AppVersion: {
-    if (needsYouTubeQuirk(exec, m_frame))
-        return jsString("");
-    // Version is everything in the user agent string past the "Mozilla/" prefix.
-    const String userAgent = m_frame->loader()->userAgent(m_frame->document() ? m_frame->document()->url() : KURL());
-    return jsString(userAgent.substring(userAgent.find('/') + 1));
-  }
-  case Product:
-    return jsString(WEBCORE_NAVIGATOR_PRODUCT);
-  case ProductSub:
-    return jsString(WEBCORE_NAVIGATOR_PRODUCT_SUB);
-  case Vendor:
-    return jsString(WEBCORE_NAVIGATOR_VENDOR);
-  case VendorSub:
-    return jsString(WEBCORE_NAVIGATOR_VENDOR_SUB);
-  case Language:
-    return jsString(defaultLanguage());
-  case UserAgent:
-    return jsString(m_frame->loader()->userAgent(m_frame->document() ? m_frame->document()->url() : KURL()));
-  case Platform:
-    return jsString(WEBCORE_NAVIGATOR_PLATFORM);
-  case _Plugins:
-    return new Plugins(exec);
-  case _MimeTypes:
-    return new MimeTypes(exec);
-  case CookieEnabled:
-    return jsBoolean(cookiesEnabled(m_frame->document()));
-  }
-  return 0;
-}
-
-/*******************************************************************/
-
-void PluginBase::cachePluginDataIfNecessary()
-{
-    if (!plugins) {
-        plugins = new Vector<PluginInfo*>;
-        mimes = new Vector<MimeClassInfo*>;
-        
-        // read configuration
-        PluginInfoStore c;
-        unsigned pluginCount = c.pluginCount();
-        for (unsigned n = 0; n < pluginCount; n++) {
-            PluginInfo* plugin = c.createPluginInfoForPluginAtIndex(n);
-            if (!plugin) 
-                continue;
-            
-            plugins->append(plugin);
-            if (plugin->mimes.isEmpty())
-                continue;
-            
-            Vector<MimeClassInfo*>::iterator end = plugin->mimes.end();
-            for (Vector<MimeClassInfo*>::iterator itr = plugin->mimes.begin(); itr != end; itr++)
-                mimes->append(*itr);
-        }
-    }
-}
-
-PluginBase::PluginBase(ExecState* exec)
-    : DOMObject(exec->lexicalGlobalObject()->objectPrototype())
-{
-    cachePluginDataIfNecessary();
-    m_plugInCacheRefCount++;
-}
-
-PluginBase::~PluginBase()
-{
-    m_plugInCacheRefCount--;
-    if (!m_plugInCacheRefCount) {
-        if (plugins) {
-            deleteAllValues(*plugins);
-            delete plugins;
-            plugins = 0;
-        }
-        if (mimes) {
-            deleteAllValues(*mimes);
-            delete mimes;
-            mimes = 0;
-        }
-    }
-}
-
-void PluginBase::refresh(bool reload)
-{
-    if (plugins) {
-        deleteAllValues(*plugins);
-        delete plugins;
-        plugins = 0;
-    }
-    if (mimes) {
-        deleteAllValues(*mimes);
-        delete mimes;
-        mimes = 0;
-    }
-    
-    refreshPlugins(reload);
-    cachePluginDataIfNecessary();
-}
-
-
-/*******************************************************************/
-
-/*
-@begin PluginsTable 2
-  length        Plugins::Length                        DontDelete|ReadOnly
-  refresh       pluginsFunctionRefresh                 DontDelete|Function 0
-@end
-*/
-
-JSValue* Plugins::getValueProperty(ExecState* exec, int token) const
-{
-  ASSERT(token == Length);
-  return jsNumber(plugins->size());
-}
-
-JSValue* Plugins::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-    return new Plugin(exec, plugins->at(slot.index()));
-}
-
-JSValue* Plugins::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-    AtomicString atomicPropertyName = propertyName;
-    Vector<PluginInfo*>::iterator end = plugins->end();
-    for (Vector<PluginInfo*>::iterator itr = plugins->begin(); itr != end; itr++) {
-        PluginInfo* pl = *itr;
-        if (pl->name == atomicPropertyName)
-            return new Plugin(exec, pl);
-    }
-    return jsUndefined();
-}
-
-bool Plugins::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
-    const HashEntry* entry = Lookup::findEntry(&PluginsTable, propertyName);
-    if (entry) {
-      if (entry->attr & Function)
-        slot.setStaticEntry(this, entry, staticFunctionGetter);
-      else
-        slot.setStaticEntry(this, entry, staticValueGetter<Plugins>);
-      return true;
-    } else {
-        // plugins[#]
-        bool ok;
-        unsigned int i = propertyName.toUInt32(&ok);
-        if (ok && i < plugins->size()) {
-            slot.setCustomIndex(this, i, indexGetter);
-            return true;
-        }
-
-        // plugin[name]
-        AtomicString atomicPropertyName = propertyName;
-        Vector<PluginInfo*>::iterator end = plugins->end();
-        for (Vector<PluginInfo*>::iterator itr = plugins->begin(); itr != end; itr++) {
-            if ((*itr)->name == atomicPropertyName) {
-                slot.setCustom(this, nameGetter);
-                return true;
-            }
-        }
-    }
-
-    return PluginBase::getOwnPropertySlot(exec, propertyName, slot);
-}
-
-/*******************************************************************/
-
-/*
-@begin MimeTypesTable 1
-  length        MimeTypes::Length       DontDelete|ReadOnly
-@end
-*/
-
-JSValue* MimeTypes::getValueProperty(ExecState* exec, int token) const
-{
-  ASSERT(token == Length);
-  return jsNumber(mimes->size());
-}
-
-JSValue* MimeTypes::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-    return new MimeType(exec, mimes->at(slot.index()));
-}
-
-JSValue* MimeTypes::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-    AtomicString atomicPropertyName = propertyName;
-    Vector<MimeClassInfo*>::iterator end = mimes->end();
-    for (Vector<MimeClassInfo*>::iterator itr = mimes->begin(); itr != end; itr++) {
-        MimeClassInfo* m = (*itr);
-        if (m->type == atomicPropertyName)
-            return new MimeType(exec, m);
-    }
-    return jsUndefined();
-}
-
-bool MimeTypes::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
-    const HashEntry* entry = Lookup::findEntry(&MimeTypesTable, propertyName);
-    if (entry) {
-      slot.setStaticEntry(this, entry, staticValueGetter<MimeTypes>);
-      return true;
-    } else {
-        // mimeTypes[#]
-        bool ok;
-        unsigned int i = propertyName.toUInt32(&ok);
-        if (ok && i < mimes->size()) {
-            slot.setCustomIndex(this, i, indexGetter);
-            return true;
-        }
-
-        // mimeTypes[name]
-        AtomicString atomicPropertyName = propertyName;
-        Vector<MimeClassInfo*>::iterator end = mimes->end();
-        for (Vector<MimeClassInfo*>::iterator itr = mimes->begin(); itr != end; itr++) {
-            if ((*itr)->type == atomicPropertyName) {
-                slot.setCustom(this, nameGetter);
-                return true;
-            }
-        }
-    }
-
-    return PluginBase::getOwnPropertySlot(exec, propertyName, slot);
-}
-
-
-/************************************************************************/
-
-/*
-@begin PluginTable 4
-  name          Plugin::Name            DontDelete|ReadOnly
-  filename      Plugin::Filename        DontDelete|ReadOnly
-  description   Plugin::Description     DontDelete|ReadOnly
-  length        Plugin::Length          DontDelete|ReadOnly
-@end
-*/
-
-JSValue* Plugin::getValueProperty(ExecState* exec, int token) const
-{
-    switch (token) {
-    case Name:
-        return jsString(m_info->name);
-    case Filename:
-        return jsString(m_info->file);
-    case Description:
-        return jsString(m_info->desc);
-    case Length: 
-        return jsNumber(m_info->mimes.size());
-    default:
-        ASSERT(0);
-        return jsUndefined();
-    }
-}
-
-JSValue* Plugin::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-    Plugin* thisObj = static_cast<Plugin*>(slot.slotBase());
-    return new MimeType(exec, thisObj->m_info->mimes.at(slot.index()));
-}
-
-JSValue* Plugin::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
-{
-    Plugin* thisObj = static_cast<Plugin*>(slot.slotBase());
-    AtomicString atomicPropertyName = propertyName;
-    Vector<MimeClassInfo*>::iterator end = thisObj->m_info->mimes.end();
-    for (Vector<MimeClassInfo*>::iterator itr = thisObj->m_info->mimes.begin(); itr != end; itr++) {
-        MimeClassInfo* m = (*itr);
-        if (m->type == atomicPropertyName)
-            return new MimeType(exec, m);
-    }
-    return jsUndefined();
-}
-
-
-bool Plugin::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
-    const HashEntry* entry = Lookup::findEntry(&PluginTable, propertyName);
-    if (entry) {
-        slot.setStaticEntry(this, entry, staticValueGetter<Plugin>);
-        return true;
-    } else {
-        // plugin[#]
-        bool ok;
-        unsigned int i = propertyName.toUInt32(&ok);
-        if (ok && i < m_info->mimes.size()) {
-            slot.setCustomIndex(this, i, indexGetter);
-            return true;
-        }
-
-        // plugin["name"]
-        AtomicString atomicPropertyName = propertyName;
-        Vector<MimeClassInfo*>::iterator end = m_info->mimes.end();
-        for (Vector<MimeClassInfo*>::iterator itr = m_info->mimes.begin(); itr != end; itr++) {
-            if ((*itr)->type == atomicPropertyName) {
-                slot.setCustom(this, nameGetter);
-                return true;
-            }
-        }
-    }
-
-    return PluginBase::getOwnPropertySlot(exec, propertyName, slot);
-}
-
-/*****************************************************************************/
-
-/*
-@begin MimeTypeTable 4
-  type          MimeType::Type          DontDelete|ReadOnly
-  suffixes      MimeType::Suffixes      DontDelete|ReadOnly
-  description   MimeType::Description   DontDelete|ReadOnly
-  enabledPlugin MimeType::EnabledPlugin DontDelete|ReadOnly
-@end
-*/
-
-JSValue* MimeType::getValueProperty(ExecState* exec, int token) const
-{
-    switch (token) {
-    case Type:
-        return jsString(m_info->type);
-    case Suffixes:
-        return jsString(m_info->suffixes);
-    case Description:
-        return jsString(m_info->desc);
-    case EnabledPlugin: {
-        Frame* frame = toJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
-        ASSERT(frame);
-        Settings* settings = frame->settings();
-        if (settings && settings->arePluginsEnabled())
-            return new Plugin(exec, m_info->plugin);
-        else
-            return jsUndefined();
-    }
-    default:
-        return jsUndefined();
-    }
-}
-
-bool MimeType::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
-    return getStaticValueSlot<MimeType, PluginBase>(exec, &MimeTypeTable, this, propertyName, slot);
-}
-
-JSValue* pluginsFunctionRefresh(ExecState* exec, JSObject*, const List& args)
-{
-    PluginBase::refresh(args[0]->toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue* navigatorProtoFuncJavaEnabled(ExecState* exec, JSObject* thisObj, const List&)
-{
-    if (!thisObj->inherits(&Navigator::info))
-        return throwError(exec, TypeError);
-    Navigator* nav = static_cast<Navigator*>(thisObj);
-    Settings* settings = nav->frame() ? nav->frame()->settings() : 0;
-    return jsBoolean(settings && settings->isJavaEnabled());
-}
-
-} // namespace
diff --git a/WebCore/bindings/js/kjs_navigator.h b/WebCore/bindings/js/kjs_navigator.h
deleted file mode 100644 (file)
index e16f7ea..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *  Copyright (C) 2000 Harri Porten (porten@kde.org)
- *  Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef kjs_navigator_h
-#define kjs_navigator_h
-
-#include "kjs_binding.h"
-
-namespace WebCore {
-
-    class Frame;
-
-    class Navigator : public DOMObject {
-    public:
-        Navigator(KJS::JSObject* prototype, Frame*);
-
-        virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);
-        KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;
-        virtual const KJS::ClassInfo* classInfo() const { return &info; }
-        static const KJS::ClassInfo info;
-
-        enum { AppCodeName, AppName, AppVersion, Language, UserAgent, Platform,
-               _Plugins, _MimeTypes, Product, ProductSub, Vendor, VendorSub, CookieEnabled };
-
-        Frame* frame() const { return m_frame; }
-
-    private:
-        Frame* m_frame;
-    };
-
-    KJS::JSValue* navigatorProtoFuncJavaEnabled(KJS::ExecState*, KJS::JSObject*, const KJS::List&);
-
-} // namespace
-
-#endif
index bec6d8301c43297c76188fab6c2850e989c70e25..7bf922cea885b7ca30fb0c499e847ce0a396cd9e 100755 (executable)
@@ -30,7 +30,6 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "Image.h"
-#include "PluginInfoStore.h"
 
 namespace WebCore {
 
index db277d5fe62615b6bfe9f495d649d46caba9c3d2..3e1d4f417830f717f038bc174e275f853cc3220b 100644 (file)
@@ -38,8 +38,8 @@
 #include "MediaList.h"
 #include "MIMETypeRegistry.h"
 #include "Page.h"
+#include "PluginData.h"
 #include "PluginDocument.h"
-#include "PluginInfoStore.h"
 #include "RegularExpression.h"
 #include "Settings.h"
 #include "TextDocument.h"
@@ -366,16 +366,20 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame
         return new FTPDirectoryDocument(this, frame);
 #endif
 
+    PluginData* pluginData = 0;
+    if (frame && frame->page())
+        pluginData = frame->page()->pluginData();
+
     // PDF is one image type for which a plugin can override built-in support.
     // We do not want QuickTime to take over all image types, obviously.
-    if ((type == "application/pdf" || type == "text/pdf") && PluginInfoStore::supportsMIMEType(type))
+    if ((type == "application/pdf" || type == "text/pdf") && pluginData && pluginData->supportsMimeType(type))
         return new PluginDocument(this, frame);
     if (Image::supportsType(type))
         return new ImageDocument(this, frame);
     // Everything else except text/plain can be overridden by plugins. In particular, Adobe SVG Viewer should be used for SVG, if installed.
     // Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a fundamental type that the browser is expected to handle,
     // and also serves as an optimization to prevent loading the plug-in database in the common case.
-    if (type != "text/plain" && PluginInfoStore::supportsMIMEType(type)) 
+    if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type)) 
         return new PluginDocument(this, frame);
     if (isTextMIMEType(type))
         return new TextDocument(this, frame);
index 703f6a6ab2bf432a80ea62a551e0df87dbe286d3..b2cf41b9a40a8ca99befb7b40ace35856a9c5bc1 100644 (file)
@@ -67,7 +67,7 @@
 #include "Page.h"
 #include "PageCache.h"
 #include "PageGroup.h"
-#include "PluginInfoStore.h"
+#include "PluginData.h"
 #include "ProgressTracker.h"
 #include "RenderPart.h"
 #include "RenderWidget.h"
@@ -1596,8 +1596,8 @@ bool FrameLoader::shouldUsePlugin(const KURL& url, const String& mimeType, bool
 {
     // Allow other plug-ins to win over QuickTime because if the user has installed a plug-in that
     // can handle TIFF (which QuickTime can also handle) they probably intended to override QT.
-    if ((mimeType == "image/tiff" || mimeType == "image/tif" || mimeType == "image/x-tiff")) {
-        String pluginName = PluginInfoStore::pluginNameForMIMEType(mimeType);
+    if (m_frame->page() && (mimeType == "image/tiff" || mimeType == "image/tif" || mimeType == "image/x-tiff")) {
+        String pluginName = m_frame->page()->pluginData()->pluginNameForMimeType(mimeType);
         if (!pluginName.isEmpty() && !pluginName.contains("QuickTime", false)) 
             return true;
     }
index 22f7489f47307392e1016f096e96952b39425bd4..edb5fb622e7e47f0e99b6c6a9288b1b2599eab08 100644 (file)
@@ -42,6 +42,7 @@
 #include "FrameView.h"
 #include "History.h"
 #include "MessageEvent.h"
+#include "Navigator.h"
 #include "Page.h"
 #include "PlatformScreen.h"
 #include "PlatformString.h"
@@ -154,6 +155,10 @@ void DOMWindow::clear()
     if (m_console)
         m_console->disconnectFrame();
     m_console = 0;
+
+    if (m_navigator)
+        m_navigator->disconnectFrame();
+    m_navigator = 0;
 }
 
 Screen* DOMWindow::screen() const
@@ -219,6 +224,13 @@ Console* DOMWindow::console() const
     return m_console.get();
 }
 
+Navigator* DOMWindow::navigator() const
+{
+    if (!m_navigator)
+        m_navigator = Navigator::create(m_frame);
+    return m_navigator.get();
+}
+
 #if ENABLE(CROSS_DOCUMENT_MESSAGING)
 void DOMWindow::postMessage(const String& message, const String& domain, const String& uri, DOMWindow* source) const
 {
index adb47310ca7b293a8aeb6b771d3904972d7ec5cc..818ff171e1597d1ea3c1bb20c169027e78d1bc6d 100644 (file)
@@ -44,6 +44,7 @@ namespace WebCore {
     class FloatRect;
     class Frame;
     class History;
+    class Navigator;
     class Screen;
 
     typedef int ExceptionCode;
@@ -69,6 +70,8 @@ namespace WebCore {
         BarInfo* scrollbars() const;
         BarInfo* statusbar() const;
         BarInfo* toolbar() const;
+        Navigator* navigator() const;
+        Navigator* clientInformation() const { return navigator(); }
 
         DOMSelection* getSelection();
 
@@ -170,6 +173,7 @@ namespace WebCore {
         mutable RefPtr<BarInfo> m_statusbar;
         mutable RefPtr<BarInfo> m_toolbar;
         mutable RefPtr<Console> m_console;
+        mutable RefPtr<Navigator> m_navigator;
     };
 
 } // namespace WebCore
index ef9bb9b44e78db662ce6bdab81d75db90219490f..cb6b438b13e29bee8ce0a25467dadf995a54ebd7 100644 (file)
@@ -44,6 +44,8 @@ module window {
         attribute [Replaceable] BarInfo scrollbars;
         attribute [Replaceable] BarInfo statusbar;
         attribute [Replaceable] BarInfo toolbar;
+        attribute [Replaceable] Navigator navigator;
+        attribute [Replaceable] Navigator clientInformation;
 
         DOMSelection getSelection();
 
index 8eec6e0f91dca9210a7e76d5e1ab92db6d24ca43..3a3dc971d02b11e4b3ba118d3a818300f273a378 100644 (file)
@@ -51,7 +51,6 @@
 #include "MoveSelectionCommand.h"
 #include "Node.h"
 #include "Page.h"
-#include "PluginInfoStore.h"
 #include "RenderFileUploadControl.h"
 #include "RenderImage.h"
 #include "ReplaceSelectionCommand.h"
index 3a04f0c67e946ff66240ceea1b39df53d1d1fb14..0d75dade4f269dbe8f7f9d3dfbf7c466860f2e50 100644 (file)
@@ -55,6 +55,7 @@
 #include "JSDOMWindow.h"
 #include "Logging.h"
 #include "MediaFeatureNames.h"
+#include "Navigator.h"
 #include "NodeList.h"
 #include "Page.h"
 #include "RegularExpression.h"
index 28a7bd117a5ea1dfc2338e145f7f7561914690e6..d83cf6d6bb0fc86e6be09fab077ea3c59ca2c2c4 100644 (file)
@@ -99,6 +99,7 @@ class KJSProxy;
 class KURL;
 class Node;
 class Page;
+class PluginData;
 class Range;
 class RegularExpression;
 class RenderPart;
diff --git a/WebCore/page/Navigator.cpp b/WebCore/page/Navigator.cpp
new file mode 100644 (file)
index 0000000..2f8aea4
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ *  Copyright (C) 2000 Harri Porten (porten@kde.org)
+ *  Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org)
+ *  Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "Navigator.h"
+
+#include "CookieJar.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
+#include "Language.h"
+#include "MimeTypeArray.h"
+#include "PlatformString.h"
+#include "PluginArray.h"
+#include "PluginData.h"
+#include "Settings.h"
+
+#ifndef WEBCORE_NAVIGATOR_PLATFORM
+#if PLATFORM(MAC) && PLATFORM(PPC)
+#define WEBCORE_NAVIGATOR_PLATFORM "MacPPC"
+#elif PLATFORM(MAC) && PLATFORM(X86)
+#define WEBCORE_NAVIGATOR_PLATFORM "MacIntel"
+#elif PLATFORM(WIN_OS)
+#define WEBCORE_NAVIGATOR_PLATFORM "Win32"
+#else
+#define WEBCORE_NAVIGATOR_PLATFORM ""
+#endif
+#endif // ifndef WEBCORE_NAVIGATOR_PLATFORM
+
+#ifndef WEBCORE_NAVIGATOR_PRODUCT
+#define WEBCORE_NAVIGATOR_PRODUCT "Gecko"
+#endif // ifndef WEBCORE_NAVIGATOR_PRODUCT
+
+#ifndef WEBCORE_NAVIGATOR_PRODUCT_SUB
+#define WEBCORE_NAVIGATOR_PRODUCT_SUB "20030107"
+#endif // ifndef WEBCORE_NAVIGATOR_PRODUCT_SUB
+
+#ifndef WEBCORE_NAVIGATOR_VENDOR
+#define WEBCORE_NAVIGATOR_VENDOR "Apple Computer, Inc."
+#endif // ifndef WEBCORE_NAVIGATOR_VENDOR
+
+#ifndef WEBCORE_NAVIGATOR_VENDOR_SUB
+#define WEBCORE_NAVIGATOR_VENDOR_SUB ""
+#endif // ifndef WEBCORE_NAVIGATOR_VENDOR_SUB
+
+
+namespace WebCore {
+
+Navigator::Navigator(Frame* frame)
+    : m_frame(frame)
+{
+}
+
+Navigator::~Navigator()
+{
+    disconnectFrame();
+}
+
+void Navigator::disconnectFrame()
+{
+    if (m_plugins) {
+        m_plugins->disconnectFrame();
+        m_plugins = 0;
+    }
+    if (m_mimeTypes) {
+        m_mimeTypes->disconnectFrame();
+        m_mimeTypes = 0;
+    }
+    m_frame = 0;
+}
+
+String Navigator::appCodeName() const
+{
+    return "Mozilla";
+}
+
+String Navigator::appName() const
+{
+    return "Netscape";
+}
+
+String Navigator::appVersion() const
+{
+    if (!m_frame)
+        return String();
+    // Version is everything in the user agent string past the "Mozilla/" prefix.
+    const String& userAgent = m_frame->loader()->userAgent(m_frame->document() ? m_frame->document()->url() : KURL());
+    return userAgent.substring(userAgent.find('/') + 1);
+}
+
+String Navigator::language() const
+{
+    return defaultLanguage();
+}
+
+String Navigator::userAgent() const
+{
+    if (!m_frame)
+        return String();
+    return m_frame->loader()->userAgent(m_frame->document() ? m_frame->document()->url() : KURL());
+}
+
+String Navigator::platform() const
+{
+    return WEBCORE_NAVIGATOR_PLATFORM;
+}
+
+PluginArray* Navigator::plugins() const
+{
+    if (!m_plugins)
+        m_plugins = PluginArray::create(m_frame);
+    return m_plugins.get();
+}
+
+MimeTypeArray* Navigator::mimeTypes() const
+{
+    if (!m_mimeTypes)
+        m_mimeTypes = MimeTypeArray::create(m_frame);
+    return m_mimeTypes.get();
+}
+
+String Navigator::product() const
+{
+    return WEBCORE_NAVIGATOR_PRODUCT;
+}
+
+String Navigator::productSub() const
+{
+    return WEBCORE_NAVIGATOR_PRODUCT_SUB;
+}
+
+String Navigator::vendor() const
+{
+    return WEBCORE_NAVIGATOR_VENDOR;
+}
+
+String Navigator::vendorSub() const
+{
+    return WEBCORE_NAVIGATOR_VENDOR_SUB;
+}
+
+bool Navigator::cookieEnabled() const
+{
+    return cookiesEnabled(m_frame->document());
+}
+
+bool Navigator::javaEnabled() const
+{
+    if (!m_frame)
+        return false;
+    return m_frame->settings()->isJavaEnabled();
+}
+
+} // namespace WebCore
diff --git a/WebCore/page/Navigator.h b/WebCore/page/Navigator.h
new file mode 100644 (file)
index 0000000..d3207f1
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+    Copyright (C) 2007 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef Navigator_h
+#define Navigator_h
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+    class Frame;
+    class MimeTypeArray;
+    class PluginData;
+    class PluginArray;
+    class String;
+
+    class Navigator : public RefCounted<Navigator> {
+    public:
+        static PassRefPtr<Navigator> create(Frame* frame) { return adoptRef(new Navigator(frame)); }
+        ~Navigator();
+
+        void disconnectFrame();
+        Frame* frame() const { return m_frame; }
+
+        String appCodeName() const;
+        String appName() const;
+        String appVersion() const;
+        String language() const;
+        String userAgent() const;
+        String platform() const;
+        PluginArray* plugins() const;
+        MimeTypeArray* mimeTypes() const;
+        String product() const;
+        String productSub() const;
+        String vendor() const;
+        String vendorSub() const;
+        bool cookieEnabled() const;
+        bool javaEnabled() const;
+
+    private:
+        Navigator(Frame*);
+        Frame* m_frame;
+        mutable RefPtr<PluginArray> m_plugins;
+        mutable RefPtr<MimeTypeArray> m_mimeTypes;
+    };
+
+}
+
+#endif
diff --git a/WebCore/page/Navigator.idl b/WebCore/page/Navigator.idl
new file mode 100644 (file)
index 0000000..9e73a02
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+    Copyright (C) 2007 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+module window {
+
+    interface Navigator {
+        readonly attribute DOMString appCodeName;
+        readonly attribute DOMString appName;
+        readonly attribute [CustomGetter] DOMString appVersion;
+        readonly attribute DOMString language;
+        readonly attribute DOMString userAgent;
+        readonly attribute DOMString platform;
+        readonly attribute PluginArray plugins;
+        readonly attribute MimeTypeArray mimeTypes;
+        readonly attribute DOMString product;
+        readonly attribute DOMString productSub;
+        readonly attribute DOMString vendor;
+        readonly attribute DOMString vendorSub;
+        readonly attribute boolean cookieEnabled;
+        boolean javaEnabled();
+    };
+
+}
index 0eefc072a359c41cc3a435cfd0f59393abfcf92e..108ddd2d6949cf0bc777041a801cccc5553f4732 100644 (file)
@@ -25,6 +25,7 @@
 #include "ContextMenuClient.h"
 #include "ContextMenuController.h"
 #include "EditorClient.h"
+#include "DOMWindow.h"
 #include "DragController.h"
 #include "FileSystem.h"
 #include "FocusController.h"
@@ -36,7 +37,9 @@
 #include "InspectorController.h"
 #include "JavaScriptDebugServer.h"
 #include "Logging.h"
+#include "Navigator.h"
 #include "PageGroup.h"
+#include "PluginData.h"
 #include "ProgressTracker.h"
 #include "RenderWidget.h"
 #include "SelectionController.h"
@@ -219,6 +222,38 @@ void Page::setNeedsReapplyStyles()
             frame->setNeedsReapplyStyles();
 }
 
+void Page::refreshPlugins(bool reload)
+{
+    if (!allPages)
+        return;
+
+    PluginData::refresh();
+
+    Vector<RefPtr<Frame> > framesNeedingReload;
+
+    HashSet<Page*>::iterator end = allPages->end();
+    for (HashSet<Page*>::iterator it = allPages->begin(); it != end; ++it) {
+        (*it)->m_pluginData = 0;
+
+        if (reload) {
+            for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+                if (frame->loader()->containsPlugins())
+                    framesNeedingReload.append(frame);
+            }
+        }
+    }
+
+    for (size_t i = 0; i < framesNeedingReload.size(); ++i)
+        framesNeedingReload[i]->loader()->reload();
+}
+
+PluginData* Page::pluginData() const
+{
+    if (!m_pluginData)
+        m_pluginData = PluginData::create(this);
+    return m_pluginData.get();
+}
+
 static Frame* incrementFrame(Frame* curr, bool forward, bool wrapFlag)
 {
     return forward
index fd5dce55372a4b0efd851b26c8be1b44ef1880d5..0cdcb543057bcf4d587587f4de1a10b3b9f4ac30 100644 (file)
@@ -56,6 +56,7 @@ namespace WebCore {
     class InspectorController;
     class Node;
     class PageGroup;
+    class PluginData;
     class ProgressTracker;
     class Selection;
     class SelectionController;
@@ -72,6 +73,9 @@ namespace WebCore {
         Page(ChromeClient*, ContextMenuClient*, EditorClient*, DragClient*, InspectorClient*);
         ~Page();
         
+        static void refreshPlugins(bool reload);
+        PluginData* pluginData() const;
+
         EditorClient* editorClient() const { return m_editorClient; }
 
         void setMainFrame(PassRefPtr<Frame>);
@@ -165,6 +169,8 @@ namespace WebCore {
         RefPtr<Frame> m_mainFrame;
         RefPtr<Node> m_focusedNode;
 
+        mutable RefPtr<PluginData> m_pluginData;
+
         EditorClient* m_editorClient;
 
         int m_frameCount;
diff --git a/WebCore/page/Plugin.h b/WebCore/page/Plugin.h
deleted file mode 100644 (file)
index 1e53184..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// -*- mode: c++; c-basic-offset: 4 -*-
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef Plugin_h
-#define Plugin_h
-
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-    class Widget;
-
-    class Plugin : public RefCounted<Plugin> {
-    public:
-        static PassRefPtr<Plugin> create(Widget* view) { return adoptRef(new Plugin(view)); }
-        Widget* view() const { return m_view; }
-        
-    private:
-        Plugin(Widget* view) : m_view(view) { }
-        Widget* m_view;
-    };
-    
-} // namespace WebCore
-
-#endif // Plugin_h
index 20609531e394817dbb43c3f8790ce087546dce87..0122716fa8ffeca39d5cf8c78e9c517e1dfbea95 100644 (file)
@@ -69,7 +69,6 @@
 #import "PlatformKeyboardEvent.h"
 #import "PlatformScrollBar.h"
 #import "PlatformWheelEvent.h"
-#import "Plugin.h"
 #import "RegularExpression.h"
 #import "RenderImage.h"
 #import "RenderListItem.h"
index 453b2eb9053e9076a39f29a91546ddbfd37afac3..da12491961f1a12c8be67aae83f32c452038cc55 100644 (file)
@@ -64,7 +64,7 @@
 #import "Page.h"
 #import "PlatformMouseEvent.h"
 #import "PlatformScreen.h"
-#import "PluginInfoStore.h"
+#import "PluginData.h"
 #import "RenderImage.h"
 #import "RenderPart.h"
 #import "RenderTreeAsText.h"
@@ -1152,7 +1152,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     
     if (WebCore::DOMImplementation::isTextMIMEType(mimeType) ||
         Image::supportsType(mimeType) ||
-        PluginInfoStore::supportsMIMEType(mimeType))
+        (m_frame->page() && m_frame->page()->pluginData()->supportsMimeType(mimeType)))
         return NO;
     
     return YES;
index 4cf21e3a3b817bc4fda49efe4f184bd9b838ddca..7d5515089ec3192f573bee34c844a3f7139db27c 100644 (file)
@@ -35,9 +35,7 @@
 @protocol WebCoreViewFactory
 
 - (NSArray *)pluginsInfo; // array of id <WebCorePluginInfo>
-- (void)refreshPlugins:(BOOL)reloadPages;
-- (NSString *)pluginNameForMIMEType:(NSString *)MIMEType;
-- (BOOL)pluginSupportsMIMEType:(NSString *)MIMEType;
+- (void)refreshPlugins;
 
 - (NSString *)inputElementAltText;
 - (NSString *)resetButtonDefaultLabel;
index 914eeddbeeec8eb533f0cd66aa2d0872e171f555..06efde56e8baf3ad57de3cae04a9f1ea952d7854 100644 (file)
@@ -48,7 +48,6 @@
 #include "ResourceHandleInternal.h"
 #include "Document.h"
 #include "Settings.h"
-#include "Plugin.h"
 #include "FrameView.h"
 #include "FramePrivate.h"
 #include "GraphicsContext.h"
index 11afdde144e91b7607df8d1f9bc864c9aa2973c7..cb5e5189e0f71d641e49702b5d951cfb1b0ac5c0 100644 (file)
@@ -45,7 +45,6 @@
 #include "NP_jsobject.h"
 #include "NotImplemented.h"
 #include "Page.h"
-#include "Plugin.h"
 #include "PluginDatabase.h"
 #include "PluginView.h"
 #include "RegularExpression.h"
index f56bf6f88c559e0290c11eab7de8a39084a7f63d..09b5c4b79cfb6b34dc17989e9bcb57b7d3f24f0d 100644 (file)
@@ -35,6 +35,7 @@
 #include "NotImplemented.h"
 #include "PluginDatabase.h"
 #include "PluginPackage.h"
+#include "PluginData.h"
 #include "SharedBuffer.h"
 
 using namespace WebCore;
@@ -77,5 +78,9 @@ float userIdleTime() { notImplemented(); return 0.0; }
 String KURL::fileSystemPath() const { notImplemented(); return String(); }
 
 PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&) { notImplemented(); return 0; }
+
+void PluginData::initPlugins() { notImplemented(); }
+void PluginData::refresh() { notImplemented(); }
+
 }
 
diff --git a/WebCore/platform/mac/PlugInInfoStoreMac.mm b/WebCore/platform/mac/PlugInInfoStoreMac.mm
deleted file mode 100644 (file)
index 2776eae..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2004 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,
- * 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 "config.h"
-#import "PluginInfoStore.h"
-
-#import "BlockExceptions.h"
-#import "Logging.h"
-#import "WebCoreViewFactory.h"
-
-namespace WebCore {
-
-String PluginInfoStore::pluginNameForMIMEType(const String& mimeType)
-{
-    return [[WebCoreViewFactory sharedFactory] pluginNameForMIMEType:mimeType];
-}
-
-PluginInfo *PluginInfoStore::createPluginInfoForPluginAtIndex(unsigned index)
-{
-    PluginInfo *pluginInfo = new PluginInfo;
-    
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
-    id <WebCorePluginInfo> plugin = [[[WebCoreViewFactory sharedFactory] pluginsInfo] objectAtIndex:index];
-    
-    pluginInfo->name = [plugin name];
-    pluginInfo->file = [plugin filename];
-    pluginInfo->desc = [plugin pluginDescription];
-
-    NSEnumerator *MIMETypeEnumerator = [plugin MIMETypeEnumerator];
-    while (NSString *MIME = [MIMETypeEnumerator nextObject]) {
-        MimeClassInfo *mime = new MimeClassInfo;
-        pluginInfo->mimes.append(mime);
-        mime->type = String(MIME).lower();
-        mime->suffixes = [[plugin extensionsForMIMEType:MIME] componentsJoinedByString:@","];
-        mime->desc = [plugin descriptionForMIMEType:MIME];
-        mime->plugin = pluginInfo;
-    }
-    
-    return pluginInfo;
-
-    END_BLOCK_OBJC_EXCEPTIONS;
-    
-    if (pluginInfo && !pluginInfo->mimes.isEmpty())
-        deleteAllValues(pluginInfo->mimes);
-    delete pluginInfo;
-
-    return 0;
-}
-
-unsigned PluginInfoStore::pluginCount() const
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return [[[WebCoreViewFactory sharedFactory] pluginsInfo] count];
-    END_BLOCK_OBJC_EXCEPTIONS;
-    
-    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;
-    [[WebCoreViewFactory sharedFactory] refreshPlugins:reloadOpenPages];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-}
-
index 6b3e2437c333f75764b685d30aabb649934f5103..7c8eb188f044618c9e2a0aae61d17ce0a0bf1538 100644 (file)
 #include "config.h"
 #include "MIMETypeRegistry.h"
 
-#include "NotImplemented.h"
-#if QT_VERSION < 0x040400
-#include "qwebobjectplugin_p.h"
-#endif
-
 namespace WebCore {
 
 struct ExtensionMap {
@@ -79,12 +74,6 @@ String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
             return e->mimeType;
         ++e;
     }
-    // ### FIXME: Qt 4.4
-#if QT_VERSION < 0x040400
-    QString type = QWebFactoryLoader::self()->mimeTypeForExtension(ext);
-    if (!type.isEmpty())
-        return type;
-#endif
 
     return "application/octet-stream";
 }
diff --git a/WebCore/plugins/MimeType.cpp b/WebCore/plugins/MimeType.cpp
new file mode 100644 (file)
index 0000000..8195a80
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "MimeType.h"
+
+#include "Frame.h"
+#include "Page.h"
+#include "Plugin.h"
+#include "PluginData.h"
+#include "Settings.h"
+
+namespace WebCore {
+
+MimeType::MimeType(PassRefPtr<PluginData> pluginData, unsigned index)
+    : m_pluginData(pluginData)
+    , m_index(index)
+{
+}
+
+MimeType::~MimeType()
+{
+}
+
+const String &MimeType::type() const
+{
+    return m_pluginData->mimes()[m_index]->type;
+}
+
+const String &MimeType::suffixes() const
+{
+    return m_pluginData->mimes()[m_index]->suffixes;
+}
+
+const String &MimeType::description() const
+{
+    return m_pluginData->mimes()[m_index]->desc;
+}
+
+PassRefPtr<Plugin> MimeType::enabledPlugin() const
+{
+    const Page* p = m_pluginData->page();
+    if (!p || !p->settings()->arePluginsEnabled())
+        return 0;
+
+    const PluginInfo *info = m_pluginData->mimes()[m_index]->plugin;
+    const Vector<PluginInfo*>& plugins = m_pluginData->plugins();
+    for (size_t i = 0; i < plugins.size(); ++i) {
+        if (plugins[i] == info)
+            return Plugin::create(m_pluginData.get(), i);
+    }
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/plugins/MimeType.h b/WebCore/plugins/MimeType.h
new file mode 100644 (file)
index 0000000..1e067da
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef MimeType_h
+#define MimeType_h
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/RefCounted.h>
+
+#include "PluginData.h"
+
+namespace WebCore {
+
+    class Plugin;
+    class String;
+
+    class MimeType : public RefCounted<MimeType> {
+    public:
+        static PassRefPtr<MimeType> create(PassRefPtr<PluginData> pluginData, unsigned index) { return adoptRef(new MimeType(pluginData, index)); }
+        ~MimeType();
+
+        const String &type() const;
+        const String &suffixes() const;
+        const String &description() const;
+        PassRefPtr<Plugin> enabledPlugin() const;
+
+    private:
+        MimeType(PassRefPtr<PluginData>, unsigned index);
+        RefPtr<PluginData> m_pluginData;
+        unsigned m_index;
+    };
+
+}
+
+#endif
diff --git a/WebCore/plugins/MimeType.idl b/WebCore/plugins/MimeType.idl
new file mode 100644 (file)
index 0000000..92cc737
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+module window {
+
+    interface MimeType {
+        readonly attribute DOMString type;
+        readonly attribute DOMString suffixes;
+        readonly attribute DOMString description;
+        readonly attribute Plugin enabledPlugin;
+    };
+
+}
diff --git a/WebCore/plugins/MimeTypeArray.cpp b/WebCore/plugins/MimeTypeArray.cpp
new file mode 100644 (file)
index 0000000..0a9d91f
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "MimeTypeArray.h"
+
+#include "AtomicString.h"
+#include "Frame.h"
+#include "Page.h"
+#include "Plugin.h"
+#include "PluginData.h"
+
+namespace WebCore {
+
+MimeTypeArray::MimeTypeArray(Frame* frame)
+    : m_frame(frame)
+{
+}
+
+MimeTypeArray::~MimeTypeArray()
+{
+}
+
+unsigned MimeTypeArray::length() const
+{
+    PluginData* data = getPluginData();
+    if (!data)
+        return 0;
+    return data->mimes().size();
+}
+
+MimeType* MimeTypeArray::item(unsigned index)
+{
+    PluginData* data = getPluginData();
+    if (!data)
+        return 0;
+    const Vector<MimeClassInfo*>& mimes = data->mimes();
+    if (index >= mimes.size())
+        return 0;
+    return MimeType::create(data, index).get();
+}
+
+bool MimeTypeArray::canGetItemsForName(const AtomicString& propertyName)
+{
+    PluginData *data = getPluginData();
+    if (!data)
+        return 0;
+    const Vector<MimeClassInfo*>& mimes = data->mimes();
+    for (unsigned i = 0; i < mimes.size(); ++i) {
+        if (mimes[i]->type == propertyName)
+            return true;
+    }
+    return false;
+}
+
+MimeType* MimeTypeArray::nameGetter(const AtomicString& propertyName)
+{
+    PluginData *data = getPluginData();
+    if (!data)
+        return 0;
+    const Vector<MimeClassInfo*>& mimes = data->mimes();
+    for (unsigned i = 0; i < mimes.size(); ++i) {
+        if (mimes[i]->type == propertyName)
+            return MimeType::create(data, i).get();
+    }
+    return 0;
+}
+
+PluginData* MimeTypeArray::getPluginData() const
+{
+    if (!m_frame)
+        return 0;
+    Page* p = m_frame->page();
+    if (!p)
+        return 0;
+    return p->pluginData();
+}
+
+} // namespace WebCore
diff --git a/WebCore/plugins/MimeTypeArray.h b/WebCore/plugins/MimeTypeArray.h
new file mode 100644 (file)
index 0000000..90b4981
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef MimeTypeArray_h
+#define MimeTypeArray_h
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace KJS {
+    class ExecState;
+    class JSValue;
+};
+
+namespace WebCore {
+
+    class AtomicString;
+    class Frame;
+    class MimeType;
+    class PluginData;
+
+    // FIXME: Generated JSMimeTypeArray.cpp doesn't include JSMimeType.h for toJS
+    KJS::JSValue* toJS(KJS::ExecState*, MimeType*);
+
+    class MimeTypeArray : public RefCounted<MimeTypeArray> {
+    public:
+        static PassRefPtr<MimeTypeArray> create(Frame* frame) { return adoptRef(new MimeTypeArray(frame)); }
+        ~MimeTypeArray();
+
+        void disconnectFrame() { m_frame = 0; }
+
+        unsigned length() const;
+        MimeType* item(unsigned index);
+        bool canGetItemsForName(const AtomicString& propertyName);
+        MimeType* nameGetter(const AtomicString& propertyName);
+    private:
+        MimeTypeArray(Frame*);
+        PluginData* getPluginData() const;
+
+        Frame* m_frame;
+    };
+}
+
+#endif
diff --git a/WebCore/plugins/MimeTypeArray.idl b/WebCore/plugins/MimeTypeArray.idl
new file mode 100644 (file)
index 0000000..4092b08
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+module window {
+
+    interface [HasNameGetter, HasIndexGetter] MimeTypeArray {
+        readonly attribute unsigned long length;
+    };
+
+}
diff --git a/WebCore/plugins/Plugin.cpp b/WebCore/plugins/Plugin.cpp
new file mode 100644 (file)
index 0000000..31eed39
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "Plugin.h"
+
+#include "AtomicString.h"
+#include "PluginData.h"
+#include "Frame.h"
+
+namespace WebCore {
+
+Plugin::Plugin(PluginData* pluginData, unsigned index)
+    : m_pluginData(pluginData)
+    , m_index(index)
+{
+}
+
+Plugin::~Plugin()
+{
+}
+
+String Plugin::name() const
+{
+    return m_pluginData->plugins()[m_index]->name;
+}
+
+String Plugin::filename() const
+{
+    return m_pluginData->plugins()[m_index]->file;
+}
+
+String Plugin::description() const
+{
+    return m_pluginData->plugins()[m_index]->desc;
+}
+
+unsigned Plugin::length() const
+{
+    return m_pluginData->plugins()[m_index]->mimes.size();
+}
+
+MimeType* Plugin::item(unsigned index)
+{
+    const Vector<PluginInfo*>& plugins = m_pluginData->plugins();
+    if (index >= plugins[m_index]->mimes.size())
+        return 0;
+
+    MimeClassInfo* mime = plugins[m_index]->mimes[index];
+
+    const Vector<MimeClassInfo*>& mimes = m_pluginData->mimes();
+    for (unsigned i = 0; i < mimes.size(); ++i)
+        if (mimes[i] == mime)
+            return MimeType::create(m_pluginData.get(), i).get();
+    return 0;
+}
+
+bool Plugin::canGetItemsForName(const AtomicString& propertyName)
+{
+    const Vector<MimeClassInfo*>& mimes = m_pluginData->mimes();
+    for (unsigned i = 0; i < mimes.size(); ++i)
+        if (mimes[i]->type == propertyName)
+            return true;
+    return false;
+}
+
+MimeType* Plugin::nameGetter(const AtomicString& propertyName)
+{
+    const Vector<MimeClassInfo*>& mimes = m_pluginData->mimes();
+    for (unsigned i = 0; i < mimes.size(); ++i)
+        if (mimes[i]->type == propertyName)
+            return MimeType::create(m_pluginData.get(), i).get();
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/plugins/Plugin.h b/WebCore/plugins/Plugin.h
new file mode 100644 (file)
index 0000000..01ea312
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef Plugin_h
+#define Plugin_h
+
+#include "MimeType.h"
+#include <wtf/RefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace KJS {
+    class ExecState;
+    class JSValue;
+};
+
+namespace WebCore {
+
+    class AtomicString;
+    class Plugin;
+    class String;
+
+    // FIXME: Generated JSPlugin.cpp doesn't include JSMimeType.h for toJS
+    KJS::JSValue* toJS(KJS::ExecState*, MimeType*);
+
+    class PluginData;
+
+    class Plugin : public RefCounted<Plugin> {
+    public:
+        static PassRefPtr<Plugin> create(PluginData* pluginData, unsigned index) { return adoptRef(new Plugin(pluginData, index)); }
+        ~Plugin();
+
+        String name() const;
+        String filename() const;
+        String description() const;
+
+        unsigned length() const;
+
+        MimeType* item(unsigned index);
+        bool canGetItemsForName(const AtomicString& propertyName);
+        MimeType* nameGetter(const AtomicString& propertyName);
+
+    private:
+        Plugin(PluginData*, unsigned index);
+        RefPtr<PluginData> m_pluginData;
+        unsigned m_index;
+    };
+
+}
+
+#endif
diff --git a/WebCore/plugins/Plugin.idl b/WebCore/plugins/Plugin.idl
new file mode 100644 (file)
index 0000000..d565e48
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+module window {
+
+    interface [HasNameGetter, HasIndexGetter] Plugin {
+        readonly attribute DOMString name;
+        readonly attribute DOMString filename;
+        readonly attribute DOMString description;
+        readonly attribute unsigned long length;
+    };
+
+}
diff --git a/WebCore/plugins/PluginArray.cpp b/WebCore/plugins/PluginArray.cpp
new file mode 100644 (file)
index 0000000..3d9cd02
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ *  Copyright (C) 2008 Trolltech ASA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "PluginArray.h"
+
+#include "AtomicString.h"
+#include "Frame.h"
+#include "Page.h"
+#include "Plugin.h"
+#include "PluginData.h"
+
+namespace WebCore {
+
+PluginArray::PluginArray(Frame* frame)
+    : m_frame(frame)
+{
+}
+
+PluginArray::~PluginArray()
+{
+}
+
+unsigned PluginArray::length() const
+{
+    PluginData* data = getPluginData();
+    if (!data)
+        return 0;
+    return data->plugins().size();
+}
+
+Plugin* PluginArray::item(unsigned index)
+{
+    PluginData* data = getPluginData();
+    if (!data)
+        return 0;
+    const Vector<PluginInfo*>& plugins = data->plugins();
+    if (index >= plugins.size())
+        return 0;
+    return Plugin::create(data, index).get();
+}
+
+bool PluginArray::canGetItemsForName(const AtomicString& propertyName)
+{
+    PluginData* data = getPluginData();
+    if (!data)
+        return 0;
+    const Vector<PluginInfo*>& plugins = data->plugins();
+    for (unsigned i = 0; i < plugins.size(); ++i) {
+        if (plugins[i]->name == propertyName)
+            return true;
+    }
+    return false;
+}
+
+Plugin* PluginArray::nameGetter(const AtomicString& propertyName)
+{
+    PluginData* data = getPluginData();
+    if (!data)
+        return 0;
+    const Vector<PluginInfo*>& plugins = data->plugins();
+    for (unsigned i = 0; i < plugins.size(); ++i) {
+        if (plugins[i]->name == propertyName)
+            return Plugin::create(data, i).get();
+    }
+    return 0;
+}
+
+void PluginArray::refresh(bool reload)
+{
+    Page::refreshPlugins(reload);
+}
+
+PluginData* PluginArray::getPluginData() const
+{
+    if (!m_frame)
+        return 0;
+    Page* p = m_frame->page();
+    if (!p)
+        return 0;
+    return p->pluginData();
+}
+
+} // namespace WebCore
diff --git a/WebCore/plugins/PluginArray.h b/WebCore/plugins/PluginArray.h
new file mode 100644 (file)
index 0000000..41b895d
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PluginArray_h
+#define PluginArray_h
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace KJS {
+    class JSValue;
+    class ExecState;
+};
+
+namespace WebCore {
+
+    class AtomicString;
+    class Frame;
+    class Plugin;
+    class PluginData;
+
+    // FIXME: Generated JSPluginArray.cpp doesn't include JSPlugin.h for toJS
+    KJS::JSValue* toJS(KJS::ExecState*, Plugin*);
+
+    class PluginArray : public RefCounted<PluginArray> {
+    public:
+        static PassRefPtr<PluginArray> create(Frame* frame) { return adoptRef(new PluginArray(frame)); }
+        ~PluginArray();
+
+        void disconnectFrame() { m_frame = 0; }
+
+        unsigned length() const;
+        Plugin* item(unsigned index);
+        bool canGetItemsForName(const AtomicString& propertyName);
+        Plugin* nameGetter(const AtomicString& propertyName);
+
+        void refresh(bool reload);
+    private:
+        PluginArray(Frame*);
+        PluginData* getPluginData() const;
+
+        Frame* m_frame;
+    };
+}
+
+#endif
diff --git a/WebCore/plugins/PluginArray.idl b/WebCore/plugins/PluginArray.idl
new file mode 100644 (file)
index 0000000..59cd652
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+module window {
+
+    interface [HasNameGetter, HasIndexGetter] PluginArray {
+        readonly attribute unsigned long length;
+        void refresh(in boolean reload);
+    };
+
+}
diff --git a/WebCore/plugins/PluginData.cpp b/WebCore/plugins/PluginData.cpp
new file mode 100644 (file)
index 0000000..d2c1ef4
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+    Copyright (C) 2000 Harri Porten (porten@kde.org)
+    Copyright (C) 2000 Daniel Molkentin (molkentin@kde.org)
+    Copyright (C) 2000 Stefan Schimanski (schimmi@kde.org)
+    Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All Rights Reserved.
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "PluginData.h"
+
+namespace WebCore {
+
+PluginData::PluginData(const Page* page)
+    : m_page(page)
+{
+    initPlugins();
+
+    for (unsigned i = 0; i < m_plugins.size(); ++i) {
+        const PluginInfo* plugin = m_plugins[i];
+        for (unsigned j = 0; j < plugin->mimes.size(); ++j)
+            m_mimes.append(plugin->mimes[j]);
+    }
+}
+
+PluginData::~PluginData()
+{
+    deleteAllValues(m_plugins);
+    deleteAllValues(m_mimes);
+}
+
+bool PluginData::supportsMimeType(const String& mimeType) const
+{
+    for (unsigned i = 0; i < m_mimes.size(); ++i)
+        if (m_mimes[i]->type == mimeType)
+            return true;
+    return false;
+}
+
+String PluginData::pluginNameForMimeType(const String& mimeType) const
+{
+    for (unsigned i = 0; i < m_mimes.size(); ++i)
+        if (m_mimes[i]->type == mimeType)
+            return m_mimes[i]->plugin->name;
+    return String();
+}
+
+}
diff --git a/WebCore/plugins/PluginData.h b/WebCore/plugins/PluginData.h
new file mode 100644 (file)
index 0000000..40e834c
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PluginData_h
+#define PluginData_h
+
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+#include "PlatformString.h"
+
+namespace WebCore {
+
+    struct Page;
+    struct PluginInfo;
+
+    struct MimeClassInfo {
+        String type;
+        String desc;
+        String suffixes;
+        PluginInfo* plugin;
+    };
+
+    struct PluginInfo {
+        String name;
+        String file;
+        String desc;
+        Vector<MimeClassInfo*> mimes;
+    };
+
+    // FIXME: merge with PluginDatabase in the future
+    class PluginData : public RefCounted<PluginData> {
+    public:
+        static PassRefPtr<PluginData> create(const Page* page) { return adoptRef(new PluginData(page)); }
+        ~PluginData();
+
+        void disconnectPage() { m_page = 0; }
+        const Page* page() const { return m_page; }
+
+        const Vector<PluginInfo*>& plugins() const { return m_plugins; }
+        const Vector<MimeClassInfo*>& mimes() const { return m_mimes; }
+
+        bool supportsMimeType(const String& mimeType) const;
+        String pluginNameForMimeType(const String& mimeType) const;
+
+        static void refresh();
+
+    private:
+        PluginData(const Page*);
+        void initPlugins();
+
+        Vector<PluginInfo*> m_plugins;
+        Vector<MimeClassInfo*> m_mimes;
+        const Page* m_page;
+    };
+
+}
+
+#endif
diff --git a/WebCore/plugins/mac/PluginDataMac.mm b/WebCore/plugins/mac/PluginDataMac.mm
new file mode 100644 (file)
index 0000000..eeb9316
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 Trolltech ASA
+ *
+ * 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,
+ * 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 "config.h"
+#import "PluginData.h"
+
+#import "BlockExceptions.h"
+#import "Logging.h"
+#import "WebCoreViewFactory.h"
+
+namespace WebCore {
+
+void PluginData::initPlugins()
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    NSArray* plugins = [[WebCoreViewFactory sharedFactory] pluginsInfo];
+    for (unsigned int i = 0; i < [plugins count]; ++i) {
+        PluginInfo* pluginInfo = new PluginInfo;
+
+        id <WebCorePluginInfo> plugin = [plugins objectAtIndex:i];
+    
+        pluginInfo->name = [plugin name];
+        pluginInfo->file = [plugin filename];
+        pluginInfo->desc = [plugin pluginDescription];
+
+        NSEnumerator* MIMETypeEnumerator = [plugin MIMETypeEnumerator];
+        while (NSString* MIME = [MIMETypeEnumerator nextObject]) {
+            MimeClassInfo* mime = new MimeClassInfo;
+            pluginInfo->mimes.append(mime);
+            mime->type = String(MIME).lower();
+            mime->suffixes = [[plugin extensionsForMIMEType:MIME] componentsJoinedByString:@","];
+            mime->desc = [plugin descriptionForMIMEType:MIME];
+            mime->plugin = pluginInfo;
+        }
+
+        m_plugins.append(pluginInfo);
+    }
+    
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return;
+}
+
+void PluginData::refresh()
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [[WebCoreViewFactory sharedFactory] refreshPlugins];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+}
+
diff --git a/WebCore/plugins/qt/PluginDataQt.cpp b/WebCore/plugins/qt/PluginDataQt.cpp
new file mode 100644 (file)
index 0000000..75a6dc1
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "PluginData.h"
+
+#include "ChromeClientQt.h"
+#include "Page.h"
+#include <qwebpage.h>
+#include <qwebpluginfactory.h>
+
+namespace WebCore {
+
+void PluginData::initPlugins()
+{
+    QWebPage* webPage = static_cast<ChromeClientQt*>(m_page->chrome()->client())->m_webPage;
+    QWebPluginFactory* factory = webPage->pluginFactory();
+    if (!factory)
+        return;
+
+    QList<QWebPluginFactory::Plugin> plugins = factory->plugins();
+    for (int i = 0; i < plugins.count(); ++i) {
+        const QWebPluginFactory::Plugin& plugin = plugins.at(i);
+
+        PluginInfo* info = new PluginInfo;
+        info->name = plugin.name;
+        info->desc = plugin.description;
+
+        for (int j = 0; j < plugin.mimeTypes.count(); ++j) {
+            const QWebPluginFactory::MimeType& mimeType = plugin.mimeTypes.at(j);
+
+            MimeClassInfo* mimeInfo = new MimeClassInfo;
+            mimeInfo->type = mimeType.name;
+            mimeInfo->desc = mimeType.description;
+            mimeInfo->suffixes = mimeType.fileExtensions.join("; ");
+
+            info->mimes.append(mimeInfo);
+        }
+
+        m_plugins.append(info);
+    }
+}
+
+void PluginData::refresh()
+{
+    // nothing to do
+}
+
+};
diff --git a/WebCore/plugins/win/PluginDataWin.cpp b/WebCore/plugins/win/PluginDataWin.cpp
new file mode 100644 (file)
index 0000000..c3f3f3a
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+    Copyright (C) 2008 Trolltech ASA
+    Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "PluginData.h"
+
+#include "PluginDatabase.h"
+#include "PluginPackage.h"
+
+namespace WebCore {
+
+void PluginData::initPlugins()
+{
+    PluginDatabase *db = PluginDatabase::installedPlugins();
+    const Vector<PluginPackage*> &plugins = db->plugins();
+
+    for (unsigned int i = 0; i < plugins.size(); ++i) {
+        PluginInfo* info = new PluginInfo;
+        PluginPackage* package = plugins[i];
+
+        info->name = package->name();
+        info->file = package->fileName();
+        info->desc = package->description();
+
+        const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
+        MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
+        for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
+            MimeClassInfo* mime = new MimeClassInfo;
+            info->mimes.append(mime);
+
+            mime->type = it->first;
+            mime->desc = it->second;
+            mime->plugin = info;
+
+            Vector<String> extensions = package->mimeToExtensions().get(mime->type);
+
+            for (unsigned i = 0; i < extensions.size(); i++) {
+                if (i > 0)
+                    mime->suffixes += ",";
+
+                mime->suffixes += extensions[i];
+            }
+        }
+
+        m_plugins.append(info);
+    }
+}
+
+void PluginData::refresh()
+{
+    PluginDatabase *db = PluginDatabase::installedPlugins();
+    db->refresh();
+}
+
+};
index 55de9b370e7564e48dbfbf37bed6e39f43290579..d12423beb2fa8bb09130dbf2c0828198534d551c 100644 (file)
@@ -97,7 +97,8 @@ INCLUDEPATH += \
     $$BASE_DIR/WebCore/rendering \
     $$BASE_DIR/WebCore/history \
     $$BASE_DIR/WebCore/xml \
-    $$BASE_DIR/WebCore/html
+    $$BASE_DIR/WebCore/html \
+    $$BASE_DIR/WebCore/plugins
 
 
 macx {
index 0fa627728bb9926ef9a8edcc78592752852deb0a..20923ac9a3161ca26bb15f499118c0da945d02d1 100644 (file)
@@ -1,3 +1,21 @@
+2008-03-07  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Darin.
+
+        Done with Lars.
+
+        Simplified WebViewFactory's refreshPlugins method to only refresh the
+        plugins and not reload the frames anymore since that's now done in a
+        platform independent manner by WebCore::Page.
+
+        Also removed the now unused pluginNameForMIMEType and
+        pluginSupportsMIMEType methods.
+
+        * WebCoreSupport/WebViewFactory.mm:
+        * WebView/WebFrame.mm:
+        * WebView/WebFrameInternal.h:
+        * WebView/WebView.mm:
+
 2008-03-08  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Darin Adler.
index c524b4bdc2e7af999edc4fd2ff40bec471a01a3b..41f3837639fa060c8098d814f30cb105399f1324 100644 (file)
     return [[WebPluginDatabase sharedDatabase] plugins];
 }
 
-- (NSString *)pluginNameForMIMEType:(NSString *)MIMEType
-{
-    return [[[WebPluginDatabase sharedDatabase] pluginForMIMEType:MIMEType] name];
-}
-
-- (void)refreshPlugins:(BOOL)reloadPages
+- (void)refreshPlugins
 {
     [[WebPluginDatabase sharedDatabase] refresh];
-    if (reloadPages) {
-        [WebView _makeAllWebViewsPerformSelector:@selector(_reloadForPluginChanges)];
-    }
-}
-
-- (BOOL)pluginSupportsMIMEType:(NSString *)MIMEType
-{
-    return [[WebPluginDatabase sharedDatabase] pluginForMIMEType:MIMEType] != nil;
 }
 
 - (WebCoreFrameBridge *)bridgeForView:(NSView *)v
index c954863534c1d750f95b3272632f3ce2d90d496a..5382429507744b510a062746365b2b0215788a5d 100644 (file)
@@ -361,16 +361,6 @@ WebView *getWebView(WebFrame *webFrame)
     return core(self)->loader()->numPendingOrLoadingRequests(recurse);
 }
 
-- (void)_reloadForPluginChanges
-{
-    Frame* coreFrame = core(self);
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
-        NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView];
-        if (([documentView isKindOfClass:[WebHTMLView class]] && coreFrame->loader()->containsPlugins()))
-            [kit(frame) reload];
-    }
-}
-
 - (void)_attachScriptDebugger
 {
     if (_private->scriptDebugger)
index 81a71d8ffd892cb0d9494c5fe2b4cbdd2591df51..6973f2a9d60905486c8c32b37a49b90c7470404e 100644 (file)
@@ -149,8 +149,6 @@ struct WebCoreHistoryItem;
 
 - (int)_numPendingOrLoadingRequests:(BOOL)recurse;
 
-- (void)_reloadForPluginChanges;
-
 - (void)_attachScriptDebugger;
 - (void)_detachScriptDebugger;
 
index 7bb5d3d753dd42a970b060ca212591aa4f7b6fbd..b71749fd81f98aa94fd35f5ade0f86a0f4518976 100644 (file)
@@ -1281,11 +1281,6 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
     [NSApp setWindowsNeedUpdate:YES];
 }
 
-- (void)_reloadForPluginChanges
-{
-    [[self mainFrame] _reloadForPluginChanges];
-}
-
 - (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL
 {
     NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
index fd0c694b9c0fef7da6721e5aaba94e33b61902f9..63121f2ee3a589078925159e7f99bb2fb73050c2 100644 (file)
@@ -26,7 +26,6 @@
 #include "qwebframe.h"
 #include "qwebnetworkinterface.h"
 #include "qwebnetworkinterface_p.h"
-#include "qwebobjectpluginconnector.h"
 #include "qwebpage.h"
 #include "qcookiejar.h"
 #include <qdebug.h>
@@ -361,7 +360,7 @@ void QWebNetworkJob::setErrorString(const QString& errorString)
 */
 bool QWebNetworkJob::cancelled() const
 {
-    return !d->resourceHandle && !d->connector;
+    return !d->resourceHandle;
 }
 
 /*!
@@ -450,7 +449,6 @@ bool QWebNetworkManager::add(ResourceHandle *handle, QWebNetworkInterface *inter
     handle->getInternal()->m_job = job;
     job->d->resourceHandle = handle;
     job->d->interface = interface;
-    job->d->connector = 0;
 
     job->d->request.init(handle->request());
 
@@ -479,7 +477,6 @@ void QWebNetworkManager::cancel(ResourceHandle *handle)
         return;
     DEBUG() << "QWebNetworkManager::cancel:" <<  job->d->request.httpHeader.toString();
     job->d->resourceHandle = 0;
-    job->d->connector = 0;
     job->d->interface->cancelJob(job);
     handle->getInternal()->m_job = 0;
 }
@@ -496,7 +493,7 @@ void QWebNetworkManager::started(QWebNetworkJob *job)
         client = job->d->resourceHandle->client();
         if (!client)
             return;
-    } else if (!job->d->connector) {
+    } else {
         return;
     }
 
@@ -571,8 +568,6 @@ void QWebNetworkManager::started(QWebNetworkJob *job)
 
     if (client)
         client->didReceiveResponse(job->d->resourceHandle, response);
-    if (job->d->connector)
-        emit job->d->connector->started(job);
 
 }
 
@@ -587,7 +582,7 @@ void QWebNetworkManager::data(QWebNetworkJob *job, const QByteArray &data)
         client = job->d->resourceHandle->client();
         if (!client)
             return;
-    } else if (!job->d->connector) {
+    } else {
         return;
     }
 
@@ -597,8 +592,6 @@ void QWebNetworkManager::data(QWebNetworkJob *job, const QByteArray &data)
     DEBUG() << "receivedData" << job->d->request.url.path();
     if (client)
         client->didReceiveData(job->d->resourceHandle, data.constData(), data.length(), data.length() /*FixMe*/);
-    if (job->d->connector)
-        emit job->d->connector->data(job, data);
 
 }
 
@@ -617,7 +610,7 @@ void QWebNetworkManager::finished(QWebNetworkJob *job, int errorCode)
         client = job->d->resourceHandle->client();
         if (!client)
             return;
-    } else if (!job->d->connector) {
+    } else {
         job->deref();
         return;
     }
@@ -645,9 +638,6 @@ void QWebNetworkManager::finished(QWebNetworkJob *job, int errorCode)
         }
     }
 
-    if (job->d->connector)
-        emit job->d->connector->finished(job, errorCode);
-
     DEBUG() << "receivedFinished done" << job->d->request.url;
 
     job->deref();
index c712ae41f34af3ad2856dccb85b8ce61583bd911..9b6f4d0b35c09f493efdcdf643af466e72a9aced 100644 (file)
@@ -57,7 +57,6 @@ public:
         , resourceHandle(0)
         , redirected(false)
         , interface(0)
-        , connector(0)
         , jobStatus(QWebNetworkJob::JobCreated)
         {}
     int ref;
@@ -69,7 +68,6 @@ public:
     bool redirected;
 
     QWebNetworkInterface *interface;
-    QWebObjectPluginConnector *connector;
     QWebNetworkJob::JobStatus jobStatus;
     QString errorString;
 };
diff --git a/WebKit/qt/Api/qwebobjectplugin.cpp b/WebKit/qt/Api/qwebobjectplugin.cpp
deleted file mode 100644 (file)
index b24d604..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
-  Copyright (C) 2007 Trolltech ASA
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Library General Public
-  License as published by the Free Software Foundation; either
-  version 2 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Library General Public License for more details.
-
-  You should have received a copy of the GNU Library General Public License
-  along with this library; see the file COPYING.LIB.  If not, write to
-  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-
-*/
-#include "qwebobjectplugin_p.h"
-#include <qwebobjectpluginconnector.h>
-#include <qcoreapplication.h>
-#include <qfileinfo.h>
-
-#if QT_VERSION < 0x040400
-
-#ifndef QT_NO_LIBRARY
-Q_GLOBAL_STATIC_WITH_ARGS(QWebFactoryLoader, loader,
-                          (QWebObjectPluginFactoryInterface_iid, QCoreApplication::libraryPaths(), QLatin1String("/webplugins")))
-#endif
-
-
-QWebFactoryLoader::QWebFactoryLoader(const char *iid, const QStringList &paths, const QString &suffix, Qt::CaseSensitivity)
-    : QFactoryLoader(iid, paths, suffix)
-{
-    QStringList plugins = keys();
-    foreach(QString k, plugins) {
-        QWebObjectPlugin *plugin = qobject_cast<QWebObjectPlugin *>(instance(k));
-        if (!plugin)
-            continue;
-        Info info;
-        info.name = k;
-        info.description = plugin->descriptionForKey(k);
-        QStringList mimetypes = plugin->mimetypesForKey(k);
-        foreach(QString m, mimetypes) {
-            MimeInfo mime;
-            mime.type = m;
-            mime.extensions = plugin->extensionsForMimetype(m);
-            info.mimes << mime;
-        }
-        m_pluginInfo.append(info);
-    }
-}
-
-QWebFactoryLoader *QWebFactoryLoader::self()
-{
-    return loader();
-}
-
-
-QString QWebFactoryLoader::descriptionForName(const QString &key) const
-{
-    foreach(const Info &info, m_pluginInfo) {
-        if (info.name == key)
-            return info.description;
-    }
-    return QString();
-}
-
-QStringList QWebFactoryLoader::mimetypesForName(const QString &key) const
-{
-    foreach(const Info &info, m_pluginInfo) {
-        if (info.name == key) {
-            QStringList mimetypes;
-            foreach (const MimeInfo &m, info.mimes)
-                mimetypes.append(m.type);
-            return mimetypes;
-        }
-    }
-    return QStringList();
-}
-
-QString QWebFactoryLoader::mimeTypeForExtension(const QString &extension)
-{
-    foreach(const Info &info, m_pluginInfo) {
-        foreach (const MimeInfo &m, info.mimes) {
-            if (m.extensions.contains(extension))
-                return m.type;
-        }
-    }
-    return QString();
-}
-
-
-QStringList QWebFactoryLoader::extensions() const
-{
-    QStringList extensions;
-    foreach(const Info &info, m_pluginInfo) {
-        foreach (const MimeInfo &m, info.mimes)
-            extensions << m.extensions;
-    }
-    return QStringList();
-
-}
-
-QString QWebFactoryLoader::nameForMimetype(const QString &mimeType) const
-{
-    foreach(const Info &info, m_pluginInfo) {
-        foreach (const MimeInfo &m, info.mimes)
-            if (m.type == mimeType)
-                return info.name;
-    }
-    return QString();
-}
-
-QObject *QWebFactoryLoader::create(QWebFrame *frame,
-                                   const QUrl &url,
-                                   const QString &_mimeType,
-                                   const QStringList &argumentNames,
-                                   const QStringList &argumentValues)
-{
-    QString mimeType = _mimeType;
-    if (mimeType.isEmpty()) {
-        QFileInfo fi(url.path());
-        mimeType = mimeTypeForExtension(fi.suffix());
-    }
-    QString name = nameForMimetype(mimeType);
-    QWebObjectPlugin *plugin = qobject_cast<QWebObjectPlugin *>(instance(name));
-    if (!plugin)
-        return 0;
-    QWebObjectPluginConnector *connector = new QWebObjectPluginConnector(frame);
-    return plugin->create(connector, url, mimeType, argumentNames, argumentValues);
-}
-
-
-
-/*! \class QWebObjectPlugin
-
-  This class is a plugin for the HTML object tag. It can be used to embed arbitrary content in a web page.
-*/
-
-
-QWebObjectPlugin::QWebObjectPlugin(QObject *parent)
-    : QObject(parent)
-{
-}
-
-QWebObjectPlugin::~QWebObjectPlugin()
-{
-}
-
-/*!
-  \fn QStringList QWebObjectPlugin::keys() const
-
-  The keys should be unique names.
-*/
-
-/*!
-  A description for \a key.
-*/
-QString QWebObjectPlugin::descriptionForKey(const QString &key) const
-{
-    return QString();
-}
-
-/*!
-  returns the mimetypes that can be handled by \a key.
-*/
-QStringList QWebObjectPlugin::mimetypesForKey(const QString &key) const
-{
-    return QStringList();
-}
-
-
-/*!
-  \fn QStringList QWebObjectPlugin::extensionsForMimetype() const
-
-  Should return a list of extensions that are recognised to match the \a mimeType.
-*/
-QStringList QWebObjectPlugin::extensionsForMimetype(const QString &mimeType) const
-{
-    return QStringList();
-}
-
-/*!
-  \fn QObject *QWebObjectPlugin::create(QWebObjectPluginConnector *connector, const QUrl &url, const QString &mimeType, const QStringList &argumentNames, const QStringList &argumentValues) const
-
-  Creates a QObject with \a connector to handle \a mimeType. \a argumentNames and \a argumentValues are a set of key-value pairs passed directly
-  from the &lt;param&gt; elements contained in the HTML object tag.
-*/
-
-#endif
diff --git a/WebKit/qt/Api/qwebobjectplugin.h b/WebKit/qt/Api/qwebobjectplugin.h
deleted file mode 100644 (file)
index 3c7caf7..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-  Copyright (C) 2007 Trolltech ASA
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Library General Public
-  License as published by the Free Software Foundation; either
-  version 2 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Library General Public License for more details.
-
-  You should have received a copy of the GNU Library General Public License
-  along with this library; see the file COPYING.LIB.  If not, write to
-  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-
-*/
-#ifndef QWEBOBJECTPLUGIN_H
-#define QWEBOBJECTPLUGIN_H
-
-#include "qwebkitglobal.h"
-#include <QtCore/qplugin.h>
-#include <QtCore/qfactoryinterface.h>
-
-#if QT_VERSION < 0x040400
-
-class QWebObjectPluginConnector;
-class QUrl;
-
-struct QWEBKIT_EXPORT QWebObjectPluginFactoryInterface : public QFactoryInterface
-{
-    virtual QObject *create(QWebObjectPluginConnector *connector,
-                            const QUrl &url,
-                            const QString &mimeType,
-                            const QStringList &argumentNames,
-                            const QStringList &argumentValues) const = 0;
-};
-
-#define QWebObjectPluginFactoryInterface_iid "com.trolltech.Qt.QWebObjectPluginFactoryInterface"
-Q_DECLARE_INTERFACE(QWebObjectPluginFactoryInterface, QWebObjectPluginFactoryInterface_iid)
-
-class QWEBKIT_EXPORT QWebObjectPlugin : public QObject, public QWebObjectPluginFactoryInterface
-{
-    Q_OBJECT
-    Q_INTERFACES(QWebObjectPluginFactoryInterface:QFactoryInterface)
-public:
-    explicit QWebObjectPlugin(QObject *parent = 0);
-    virtual ~QWebObjectPlugin();
-
-    virtual QStringList keys() const = 0;
-
-    virtual QString descriptionForKey(const QString &key) const;
-    virtual QStringList mimetypesForKey(const QString &key) const;
-    virtual QStringList extensionsForMimetype(const QString &mimeType) const;
-    virtual QObject *create(QWebObjectPluginConnector *connector,
-                            const QUrl &url,
-                            const QString &mimeType,
-                            const QStringList &argumentNames,
-                            const QStringList &argumentValues) const = 0;
-};
-
-#endif
-
-#endif
diff --git a/WebKit/qt/Api/qwebobjectplugin_p.h b/WebKit/qt/Api/qwebobjectplugin_p.h
deleted file mode 100644 (file)
index e20261f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef QWEBOBJECTPLUGIN_P_H
-#define QWEBOBJECTPLUGIN_P_H
-
-#include <QtCore/qglobal.h>
-#include "qwebobjectplugin.h"
-
-#if QT_VERSION < 0x040400
-
-/*
-  FIXME: This is copied from qfactoryloader_p.h.
-  Remove this once we made qfactoryloader public in Qt
-*/
-class QFactoryLoaderPrivate;
-
-class Q_CORE_EXPORT QFactoryLoader : public QObject
-{
-    Q_OBJECT_FAKE
-    Q_DECLARE_PRIVATE(QFactoryLoader)
-
-public:
-    QFactoryLoader(const char *iid,
-                   const QStringList &paths = QStringList(),
-                   const QString &suffix = QString(),
-                   Qt::CaseSensitivity = Qt::CaseSensitive);
-    ~QFactoryLoader();
-
-    QStringList keys() const;
-    QObject *instance(const QString &key) const;
-
-};
-
-class QWebFrame;
-
-class QWebFactoryLoader : public QFactoryLoader
-{
-    Q_OBJECT
-public:
-    QWebFactoryLoader(const char *iid,
-                      const QStringList &paths = QStringList(),
-                      const QString &suffix = QString(),
-                      Qt::CaseSensitivity = Qt::CaseSensitive);
-
-    static QWebFactoryLoader *self();
-
-    QStringList names() const { return keys(); }
-    QStringList extensions() const;
-    QString descriptionForName(const QString &key) const;
-    QStringList mimetypesForName(const QString &key) const;
-    QString nameForMimetype(const QString &mimeType) const;
-    inline bool supportsMimeType(const QString &mimeType) const {
-        return !nameForMimetype(mimeType).isEmpty();
-    }
-
-    QString mimeTypeForExtension(const QString &extension);
-
-    QObject *create(QWebFrame *frame,
-                    const QUrl &url,
-                    const QString &mimeType,
-                    const QStringList &argumentNames,
-                    const QStringList &argumentValues);
-
-    struct MimeInfo {
-        QString type;
-        QStringList extensions;
-    };
-    struct Info {
-        QString name;
-        QString description;
-        QList<MimeInfo> mimes;
-    };
-    QList<Info> m_pluginInfo;
-};
-
-#endif
-
-#endif
diff --git a/WebKit/qt/Api/qwebobjectpluginconnector.cpp b/WebKit/qt/Api/qwebobjectpluginconnector.cpp
deleted file mode 100644 (file)
index f53c164..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-  Copyright (C) 2007 Trolltech ASA
-  
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Library General Public
-  License as published by the Free Software Foundation; either
-  version 2 of the License, or (at your option) any later version.
-  
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Library General Public License for more details.
-  
-  You should have received a copy of the GNU Library General Public License
-  along with this library; see the file COPYING.LIB.  If not, write to
-  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-  
-*/
-#include "qwebobjectpluginconnector.h"
-#if QT_VERSION < 0x040400
-#include "qwebnetworkinterface.h"
-#include "qwebnetworkinterface_p.h"
-#include "qwebframe.h"
-#include "qwebpage.h"
-
-struct QWebObjectPluginConnectorPrivate
-{
-    QWebFrame *frame;
-};
-
-QWebObjectPluginConnector::QWebObjectPluginConnector(QWebFrame *frame)
-{
-    d = new QWebObjectPluginConnectorPrivate;
-    d->frame = frame;
-}
-
-QWebFrame *QWebObjectPluginConnector::frame() const
-{
-    return d->frame;
-}
-
-QWidget *QWebObjectPluginConnector::pluginParentWidget() const
-{
-    return d->frame->page()->view();
-}
-
-QWebNetworkJob *QWebObjectPluginConnector::requestUrl(const QWebNetworkRequest &request, Target target)
-{
-    if (target != Plugin)
-        return 0;
-
-    QWebNetworkJob *job = new QWebNetworkJob;
-    QWebNetworkJobPrivate *p = job->d;
-    p->interface = d->frame->page()->networkInterface();
-    p->connector = this;
-
-    p->request = *request.d;
-
-    d->frame->page()->networkInterface()->addJob(job);
-    return job;
-}
-
-#endif
diff --git a/WebKit/qt/Api/qwebobjectpluginconnector.h b/WebKit/qt/Api/qwebobjectpluginconnector.h
deleted file mode 100644 (file)
index 62251a3..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  Copyright (C) 2007 Trolltech ASA
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Library General Public
-  License as published by the Free Software Foundation; either
-  version 2 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Library General Public License for more details.
-
-  You should have received a copy of the GNU Library General Public License
-  along with this library; see the file COPYING.LIB.  If not, write to
-  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-
-*/
-#ifndef QWEBOBJECTPLUGINCONNECTOR_H
-#define QWEBOBJECTPLUGINCONNECTOR_H
-
-#include "qwebkitglobal.h"
-#include <QtCore/qobject.h>
-
-#if QT_VERSION < 0x040400
-
-#include "qwebnetworkinterface.h"
-
-class QWebFrame;
-class QWebPage;
-class QWidget;
-class QUrl;
-class QWebObjectPluginConnectorPrivate;
-class QWebFactoryLoader;
-class QWebNetworkManager;
-
-class QWEBKIT_EXPORT QWebObjectPluginConnector : public QObject
-{
-    Q_OBJECT
-public:
-    QWebFrame *frame() const;
-    QWidget *pluginParentWidget() const;
-
-    enum Target {
-        Plugin,
-        New,
-        Self,
-        Parent,
-        Top
-    };
-    QWebNetworkJob *requestUrl(const QWebNetworkRequest &request, Target target = Plugin);
-
-signals:
-    void started(QWebNetworkJob*);
-    void data(QWebNetworkJob*, const QByteArray &data);
-    void finished(QWebNetworkJob*, int errorCode);
-
-private:
-    friend class QWebFactoryLoader;
-    friend class QWebNetworkManager;
-    QWebObjectPluginConnector(QWebFrame *frame);
-
-    QWebObjectPluginConnectorPrivate *d;
-};
-
-#endif
-
-#endif
index 6e5e9845808b842303f32bef08da2b16f9028500..4121a41d22af07c7182e96381d8cecd84dedc2a6 100644 (file)
@@ -128,6 +128,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
     networkInterface = 0;
 #else
     networkManager = 0;
+    pluginFactory = 0;
 #endif
     insideOpenCall = false;
 
@@ -1406,6 +1407,16 @@ QNetworkAccessManager *QWebPage::networkAccessManager() const
     return d->networkManager;
 }
 
+void QWebPage::setPluginFactory(QWebPluginFactory *factory)
+{
+    d->pluginFactory = factory;
+}
+
+QWebPluginFactory *QWebPage::pluginFactory() const
+{
+    return d->pluginFactory;
+}
+
 #endif
 
 /*!
index e76f9354235d64b6825885e41e451215fe58806b..8557c3195e64e10d7c6779eb09d2294c06f6095d 100644 (file)
@@ -42,6 +42,7 @@ class QWebHistory;
 class QWebPagePrivate;
 class QWebFrameData;
 class QWebNetworkInterface;
+class QWebPluginFactory;
 
 namespace WebCore {
     class ChromeClientQt;
@@ -171,6 +172,9 @@ public:
 #else
     void setNetworkAccessManager(QNetworkAccessManager *manager);
     QNetworkAccessManager *networkAccessManager() const;
+
+    void setPluginFactory(QWebPluginFactory *factory);
+    QWebPluginFactory *pluginFactory() const;
 #endif
 
     quint64 totalBytes() const;
index 80b1e29329608d0197ccc9121e11966e48ade819..64edd3229426b1f9a2b579ddbb3ad92aa36790a5 100644 (file)
@@ -154,6 +154,10 @@ public:
     QWebSettings *settings;
 
     QAction *actions[QWebPage::WebActionCount];
+
+#if QT_VERSION >= 0x040400
+    QWebPluginFactory *pluginFactory;
+#endif
 };
 
 #endif
diff --git a/WebKit/qt/Api/qwebpluginfactory.cpp b/WebKit/qt/Api/qwebpluginfactory.cpp
new file mode 100644 (file)
index 0000000..cb5d455
--- /dev/null
@@ -0,0 +1,23 @@
+#include "config.h"
+#include "qwebpluginfactory.h"
+
+QWebPluginFactory::QWebPluginFactory(QObject *parent)
+    : QObject(parent)
+{
+}
+
+QWebPluginFactory::~QWebPluginFactory()
+{
+}
+
+void QWebPluginFactory::refreshPlugins()
+{
+}
+
+bool QWebPluginFactory::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output)
+{
+}
+
+bool QWebPluginFactory::supportsExtension(Extension extension) const
+{
+}
diff --git a/WebKit/qt/Api/qwebpluginfactory.h b/WebKit/qt/Api/qwebpluginfactory.h
new file mode 100644 (file)
index 0000000..e305f5b
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+  Copyright (C) 2007 Trolltech ASA
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Library General Public
+  License as published by the Free Software Foundation; either
+  version 2 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Library General Public License for more details.
+
+  You should have received a copy of the GNU Library General Public License
+  along with this library; see the file COPYING.LIB.  If not, write to
+  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+  Boston, MA 02110-1301, USA.
+
+*/
+#ifndef QWEBPLUGINFACTORY_H
+#define QWEBPLUGINFACTORY_H
+
+#include "qwebkitglobal.h"
+
+#include <QtCore/qobject.h>
+#include <QtCore/qstringlist.h>
+
+class QUrl;
+class QWebPluginFactoryPrivate;
+class QString;
+
+class QWEBKIT_EXPORT QWebPluginFactory : public QObject
+{
+    Q_OBJECT
+public:
+    struct MimeType {
+        QString name;
+        QString description;
+        QStringList fileExtensions;
+    };
+
+    struct Plugin {
+        QString name;
+        QString description;
+        QList<MimeType> mimeTypes;
+    };
+
+    explicit QWebPluginFactory(QObject *parent = 0);
+    virtual ~QWebPluginFactory();
+
+    virtual QList<Plugin> plugins() const = 0;
+    virtual void refreshPlugins();
+
+    virtual QObject *create(const QString &mimeType,
+                            const QUrl &url,
+                            const QStringList &argumentNames,
+                            const QStringList &argumentValues) const = 0;
+
+    enum Extension {
+    };
+    class ExtensionOption
+    {};
+    class ExtensionReturn
+    {};
+    virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
+    virtual bool supportsExtension(Extension extension) const;
+
+private:
+    QWebPluginFactoryPrivate *d;
+};
+
+#endif
index f777741eed0df4da38350c42d7384d4dc3c620c4..0102d8f54bfddc1a7a095233fb8225cbde3cf7bb 100644 (file)
@@ -1,3 +1,41 @@
+2008-03-07  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Darin.
+
+        Done with Lars.
+
+        Replaced the QWebObjectPlugin interfaces with QWebPluginFactory.
+
+        * Api/qwebnetworkinterface.cpp:
+        (QWebNetworkManager::add):
+        (QWebNetworkManager::cancel):
+        (QWebNetworkManager::started):
+        (QWebNetworkManager::data):
+        (QWebNetworkManager::finished):
+        * Api/qwebnetworkinterface_p.h:
+        (QWebNetworkJobPrivate::QWebNetworkJobPrivate):
+        * Api/qwebobjectplugin.cpp: Removed.
+        * Api/qwebobjectplugin.h: Removed.
+        * Api/qwebobjectplugin_p.h: Removed.
+        * Api/qwebobjectpluginconnector.cpp: Removed.
+        * Api/qwebobjectpluginconnector.h: Removed.
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::QWebPagePrivate):
+        (QWebPage::setPluginFactory):
+        (QWebPage::pluginFactory):
+        * Api/qwebpage.h:
+        * Api/qwebpage_p.h:
+        * Api/qwebpluginfactory.cpp: Added.
+        (QWebPluginFactory::QWebPluginFactory):
+        (QWebPluginFactory::~QWebPluginFactory):
+        (QWebPluginFactory::refreshPlugins):
+        (QWebPluginFactory::extension):
+        * Api/qwebpluginfactory.h: Added.
+        (MimeType::):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::objectContentType):
+        (WebCore::FrameLoaderClientQt::createPlugin):
+
 2008-03-07  Simon Hausmann  <hausmann@webkit.org>
 
         Fix the Qt build.
index ed91b869ba0674b3cb554ea89141587102e28802..dda0ceeda475f827bd2014342bb7c9a13f57ccab 100644 (file)
@@ -37,6 +37,7 @@
 #include "MIMETypeRegistry.h"
 #include "ResourceResponse.h"
 #include "Page.h"
+#include "PluginData.h"
 #include "ProgressTracker.h"
 #include "ResourceRequest.h"
 #include "HistoryItem.h"
@@ -50,6 +51,7 @@
 #include "qwebframe.h"
 #include "qwebframe_p.h"
 #include "qwebhistoryinterface.h"
+#include "qwebpluginfactory.h"
 
 #include <qfileinfo.h>
 
@@ -60,7 +62,6 @@
 #include <QNetworkReply>
 #else
 #include "qwebnetworkinterface_p.h"
-#include "qwebobjectplugin_p.h"
 #endif
 
 namespace WebCore
@@ -907,11 +908,8 @@ ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const
     if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
         return ObjectContentImage;
 
-    // ### FIXME Qt 4.4
-#if QT_VERSION < 0x040400
-    if (QWebFactoryLoader::self()->supportsMimeType(mimeType))
-        return ObjectContentNetscapePlugin;
-#endif
+    if (m_frame->page() && m_frame->page()->pluginData()->supportsMimeType(mimeType))
+        return ObjectContentOtherPlugin;
 
     if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
         return ObjectContentFrame;
@@ -972,11 +970,11 @@ Widget* FrameLoaderClientQt::createPlugin(const IntSize&, Element* element, cons
         }
     }
 
-    // ### FIXME: qt 4.4
-#if QT_VERSION < 0x040400
-    if (!object)
-        object = QWebFactoryLoader::self()->create(m_webFrame, qurl, mimeType, params, values);
-#endif
+    if (!object) {
+        QWebPluginFactory* factory = m_webFrame->page()->pluginFactory();
+        if (factory)
+            object = factory->create(mimeType, qurl, params, values);
+    }
 
     if (object) {
         QWidget *widget = qobject_cast<QWidget *>(object);
index 665129bf0ac60c71d31ee760d9274e8e7df12b0b..fbc3b9d30477f66522043cd2a47df5fdc105e434 100644 (file)
@@ -1,3 +1,19 @@
+2008-03-07  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Darin.
+
+        Done with Lars.
+
+        Ported the netscape test plugin to QWebPluginFactory.
+
+        * DumpRenderTree/qt/DumpRenderTree.cpp:
+        (WebCore::WebPage::WebPage):
+        * DumpRenderTree/qt/main.cpp:
+        * DumpRenderTree/qt/testplugin.cpp:
+        (TestPlugin::plugins):
+        (TestPlugin::create):
+        * DumpRenderTree/qt/testplugin.h:
+
 2008-03-09  Steve Falkenburg  <sfalken@apple.com>
 
         Stop Windows build if an error occurs in a prior project.
index 5df8a381a4eb120778ed5efc22406675684c3a92..2e4970af0fd78cd78df1be879986af2f8cca7ffb 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "DumpRenderTree.h"
 #include "jsobjects.h"
+#include "testplugin.h"
 
 #include <QDir>
 #include <QFile>
@@ -87,6 +88,8 @@ WebPage::WebPage(QWidget *parent, DumpRenderTree *drt)
     settings()->setAttribute(QWebSettings::LinksIncludedInFocusChain, false);
     connect(this, SIGNAL(geometryChangeRequest(const QRect &)),
             this, SLOT(setViewGeometry(const QRect & )));
+
+    setPluginFactory(new TestPlugin(this));
 }
 
 QWebPage *WebPage::createWindow()
index dd4c0e92cc4ed63714fe55616072babe19f4fba1..738be7f0881f1885ecbb84e16245244f1ced7fe1 100644 (file)
@@ -28,7 +28,6 @@
  */
 
 #include "DumpRenderTree.h"
-#include "testplugin.h"
 
 #include <qstringlist.h>
 #include <qapplication.h>
 #include <execinfo.h>
 #endif
 
-#if QT_VERSION < 0x040400
-Q_IMPORT_PLUGIN(testplugin)
-#endif
-
 void messageHandler(QtMsgType type, const char *message)
 {
     if (type == QtCriticalMsg) {
index 27558c9d4007f3d910767bca49ab41ab3c24170a..f3e0399eebd11e81e2d3dbfc2f0ba01102fb02d3 100644 (file)
  */
 #include "testplugin.h"
 
-#if QT_VERSION < 0x040400
-
 TestPlugin::TestPlugin(QObject *parent)
-    : QWebObjectPlugin(parent)
+    : QWebPluginFactory(parent)
 {
 }
 
@@ -38,34 +36,32 @@ TestPlugin::~TestPlugin()
 {
 }
 
-QStringList TestPlugin::keys() const
+QList<QWebPluginFactory::Plugin> TestPlugin::plugins() const
 {
-    return QStringList(QLatin1String("testplugin"));
-}
+    QWebPluginFactory::Plugin plugin;
 
-QString TestPlugin::descriptionForKey(const QString &) const
-{
-    return QLatin1String("testdescription");
-}
+    plugin.name = "testplugin";
+    plugin.description = "testdescription";
+    MimeType mimeType;
+    mimeType.name = "testtype";
+    mimeType.fileExtensions.append("testsuffixes");
+    plugin.mimeTypes.append(mimeType);
 
-QStringList TestPlugin::mimetypesForKey(const QString &) const
-{
-    return QStringList(QLatin1String("testtype"));
-}
+    plugin.name = "testplugin2";
+    plugin.description = "testdescription2";
+    mimeType.name = "testtype2";
+    mimeType.fileExtensions.append("testsuffixes2");
+    mimeType.fileExtensions.append("testsuffixes3");
+    plugin.mimeTypes.append(mimeType);
 
-QStringList TestPlugin::extensionsForMimetype(const QString &) const
-{
-    return QStringList(QLatin1String("testsuffixes"));
+    return QList<QWebPluginFactory::Plugin>() << plugin;
 }
 
-QObject *TestPlugin::create(QWebObjectPluginConnector *,
-                            const QUrl &,
-                            const QString &,
-                            const QStringList &,
-                            const QStringList &) const
+QObject *TestPlugin::create(const QString &mimeType,
+                            const QUrl &url,
+                            const QStringList &argumentNames,
+                            const QStringList &argumentValues) const
 {
     return 0;
 }
 
-Q_EXPORT_PLUGIN2(testplugin, TestPlugin)
-#endif
index e30506934e9b383733a37f5b4c32c816b45e935a..ecfd9775fd80c4599014c103dfc413a775093595 100644 (file)
  * (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 <qglobal.h>
-#if QT_VERSION < 0x040400
-#define QT_STATICPLUGIN
-#include <qwebobjectplugin.h>
+#include <qwebpluginfactory.h>
 
 
-class TestPlugin : public QWebObjectPlugin
+class TestPlugin : public QWebPluginFactory
 {
 public:
     explicit TestPlugin(QObject *parent = 0);
     virtual ~TestPlugin();
 
-    virtual QStringList keys() const;
+    virtual QList<Plugin> plugins() const;
 
-    virtual QString descriptionForKey(const QString &key) const;
-    virtual QStringList mimetypesForKey(const QString &key) const;
-    virtual QStringList extensionsForMimetype(const QString &mimeType) const;
-    virtual QObject *create(QWebObjectPluginConnector *connector,
+    virtual QObject *create(const QString &mimeType,
                             const QUrl &url,
-                            const QString &mimeType,
                             const QStringList &argumentNames,
                             const QStringList &argumentValues) const;
+
 };
 
-#endif