2008-03-07 Simon Hausmann <hausmann@webkit.org>
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: http://svn.webkit.org/repository/webkit/trunk@30923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/ChangeLog b/ChangeLog
index ea3e44d..37a67d7 100644
--- 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.
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d640d2f..694a730 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -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
index 0000000..6d7976e
--- /dev/null
+++ b/LayoutTests/fast/js/navigator-plugins-crash-expected.txt
@@ -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
index 0000000..c64ff94
--- /dev/null
+++ b/LayoutTests/fast/js/navigator-plugins-crash.html
@@ -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>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1b301ce..2cdbafc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -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.
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index f5ef106..52e447c 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -33,6 +33,7 @@
$(WebCore)/dom \
$(WebCore)/html \
$(WebCore)/page \
+ $(WebCore)/plugins \
$(WebCore)/storage \
$(WebCore)/xml \
$(WebCore)/svg \
@@ -343,10 +344,14 @@
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 \
\
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 16f2e07..2c0a77a 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -54,7 +54,6 @@
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 @@
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 @@
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 @@
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/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/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/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/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 @@
$(WebCore)/page \
$(WebCore)/storage \
$(WebCore)/svg \
- $(WebCore)/xml
+ $(WebCore)/xml \
+ $(WebCore)/plugins
DerivedSources/JS%.h: DerivedSources/JS%.cpp;
@@ -2070,6 +2094,5 @@
JSDOMWindowBase.lut.h \
JSRGBColor.lut.h \
JSXMLHttpRequest.lut.h \
- JSXSLTProcessor.lut.h \
- kjs_navigator.lut.h
+ JSXSLTProcessor.lut.h
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index a88f40b..48e7f8a 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -253,8 +253,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
$$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 @@
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 @@
../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 @@
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
}
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 35ed008..532e9a1 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -1366,6 +1366,22 @@
>
</File>
<File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSMimeType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSMimeType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSMimeTypeArray.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSMimeTypeArray.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMouseEvent.cpp"
>
</File>
@@ -1390,6 +1406,14 @@
>
</File>
<File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSNavigator.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSNavigator.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSNode.cpp"
>
</File>
@@ -1438,6 +1462,22 @@
>
</File>
<File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSPlugin.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSPlugin.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSPluginArray.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\WebKitBuild\obj\WebCore\DerivedSources\JSPluginArray.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSProcessingInstruction.cpp"
>
</File>
@@ -2992,11 +3032,15 @@
>
</File>
<File
- RelativePath="..\page\Page.cpp"
+ RelativePath="..\page\Navigator.cpp"
>
</File>
<File
- RelativePath="..\page\Page.h"
+ RelativePath="..\page\Navigator.h"
+ >
+ </File>
+ <File
+ RelativePath="..\page\Page.cpp"
>
</File>
<File
@@ -9473,6 +9517,10 @@
>
</File>
<File
+ RelativePath="..\bindings\js\JSMimeTypeArrayCustom.cpp"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSNamedNodeMapCustom.cpp"
>
</File>
@@ -9485,6 +9533,10 @@
>
</File>
<File
+ RelativePath="..\bindings\js\JSNavigatorCustom.cpp"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSNodeCustom.cpp"
>
</File>
@@ -9517,6 +9569,14 @@
>
</File>
<File
+ RelativePath="..\bindings\js\JSPluginArrayCustom.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSPluginCustom.cpp"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSSQLResultSetRowListCustom.cpp"
>
</File>
@@ -9617,14 +9677,6 @@
>
</File>
<File
- RelativePath="..\bindings\js\kjs_navigator.cpp"
- >
- </File>
- <File
- RelativePath="..\bindings\js\kjs_navigator.h"
- >
- </File>
- <File
RelativePath="..\bindings\js\kjs_proxy.cpp"
>
</File>
@@ -9654,6 +9706,22 @@
Name="plugins"
>
<File
+ RelativePath="..\plugins\MimeType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\plugins\MimeType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\plugins\MimeTypeArray.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\plugins\MimeTypeArray.h"
+ >
+ </File>
+ <File
RelativePath="..\plugins\npapi.cpp"
>
</File>
@@ -9662,6 +9730,30 @@
>
</File>
<File
+ RelativePath="..\plugins\Plugin.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\plugins\Plugin.h"
+ >
+ </File>
+ <File
+ RelativePath="..\plugins\PluginArray.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\plugins\PluginArray.h"
+ >
+ </File>
+ <File
+ RelativePath="..\plugins\PluginData.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\plugins\PluginData.h"
+ >
+ </File>
+ <File
RelativePath="..\plugins\PluginDatabase.cpp"
>
</File>
@@ -9713,6 +9805,10 @@
>
</File>
<File
+ RelativePath="..\plugins\win\PluginDataWin.cpp"
+ >
+ </File>
+ <File
RelativePath="..\plugins\win\PluginPackageWin.cpp"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 9e54358..14ddee2 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -559,7 +559,6 @@
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 */; };
@@ -1639,8 +1638,6 @@
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, ); }; };
@@ -2043,7 +2040,6 @@
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 */; };
@@ -2574,6 +2570,33 @@
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 */; };
@@ -4896,7 +4919,6 @@
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>"; };
@@ -5926,8 +5948,6 @@
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>"; };
@@ -6164,7 +6184,6 @@
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>"; };
@@ -6568,6 +6587,38 @@
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>"; };
@@ -8171,6 +8222,7 @@
BC9854430CD3D9D000069BC1 /* Window */,
A83B79220CCB00F0000B0825 /* XML */,
A83B790C0CCAFF83000B0825 /* XPath */,
+ A9D247F90D757E4100FDF959 /* Plugins */,
);
name = "Derived Sources";
path = DerivedSources/WebCore;
@@ -8402,6 +8454,21 @@
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;
@@ -8527,7 +8594,6 @@
BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */,
BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */,
BC7B2AF90450824100A8000F /* PlatformScrollBarMac.mm */,
- A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */,
0668E18E0ADD9640004128E0 /* PopupMenuMac.mm */,
1CE24F960D7CAF0E007E04C2 /* SchedulePairMac.mm */,
BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */,
@@ -8563,6 +8629,9 @@
65BF02180974806300C43196 /* page */ = {
isa = PBXGroup;
children = (
+ A9C6E65D0D746694006442E9 /* Navigator.idl */,
+ A9C6E5A30D746458006442E9 /* Navigator.cpp */,
+ A9C6E5A40D746458006442E9 /* Navigator.h */,
06693F450BFBC91600216072 /* inspector */,
93C09A820B064F05005ABD4D /* mac */,
8538F0000AD71770006A81D1 /* AbstractView.idl */,
@@ -10786,6 +10855,21 @@
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 = (
@@ -11652,8 +11736,6 @@
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 */,
@@ -11709,6 +11791,11 @@
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 */,
@@ -11771,6 +11858,8 @@
BC124EFE0C26447A009E2349 /* JSBarInfo.h */,
BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */,
BC98543C0CD3D98B00069BC1 /* JSConsole.h */,
+ A9D247F50D757E3300FDF959 /* JSNavigator.cpp */,
+ A9D247F60D757E3300FDF959 /* JSNavigator.h */,
BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */,
BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */,
1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */,
@@ -13916,7 +14005,6 @@
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 */,
@@ -14344,7 +14432,6 @@
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 */,
@@ -14445,6 +14532,17 @@
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;
};
@@ -15560,7 +15658,6 @@
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 */,
@@ -15983,7 +16080,6 @@
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 */,
@@ -16067,6 +16163,22 @@
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;
};
diff --git a/WebCore/bindings/js/JSDOMWindowBase.cpp b/WebCore/bindings/js/JSDOMWindowBase.cpp
index 0b301f9..a78292e 100644
--- a/WebCore/bindings/js/JSDOMWindowBase.cpp
+++ b/WebCore/bindings/js/JSDOMWindowBase.cpp
@@ -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 @@
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 @@
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
index 0000000..7da3882
--- /dev/null
+++ b/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp
@@ -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
index 0000000..ce59257
--- /dev/null
+++ b/WebCore/bindings/js/JSNavigatorCustom.cpp
@@ -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
index 0000000..d7ae4d3
--- /dev/null
+++ b/WebCore/bindings/js/JSPluginArrayCustom.cpp
@@ -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
index 0000000..e7079d9
--- /dev/null
+++ b/WebCore/bindings/js/JSPluginCustom.cpp
@@ -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
index eb1a872..0000000
--- a/WebCore/bindings/js/kjs_navigator.cpp
+++ /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
index e16f7ea..0000000
--- a/WebCore/bindings/js/kjs_navigator.h
+++ /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
diff --git a/WebCore/dom/Clipboard.cpp b/WebCore/dom/Clipboard.cpp
index bec6d83..7bf922c 100755
--- a/WebCore/dom/Clipboard.cpp
+++ b/WebCore/dom/Clipboard.cpp
@@ -30,7 +30,6 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "Image.h"
-#include "PluginInfoStore.h"
namespace WebCore {
diff --git a/WebCore/dom/DOMImplementation.cpp b/WebCore/dom/DOMImplementation.cpp
index db277d5..3e1d4f4 100644
--- a/WebCore/dom/DOMImplementation.cpp
+++ b/WebCore/dom/DOMImplementation.cpp
@@ -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 @@
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);
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 703f6a6..b2cf41b 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -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 @@
{
// 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;
}
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 22f7489..edb5fb6 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -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 @@
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 @@
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
{
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index adb4731..818ff17 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -44,6 +44,7 @@
class FloatRect;
class Frame;
class History;
+ class Navigator;
class Screen;
typedef int ExceptionCode;
@@ -69,6 +70,8 @@
BarInfo* scrollbars() const;
BarInfo* statusbar() const;
BarInfo* toolbar() const;
+ Navigator* navigator() const;
+ Navigator* clientInformation() const { return navigator(); }
DOMSelection* getSelection();
@@ -170,6 +173,7 @@
mutable RefPtr<BarInfo> m_statusbar;
mutable RefPtr<BarInfo> m_toolbar;
mutable RefPtr<Console> m_console;
+ mutable RefPtr<Navigator> m_navigator;
};
} // namespace WebCore
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index ef9bb9b..cb6b438 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -44,6 +44,8 @@
attribute [Replaceable] BarInfo scrollbars;
attribute [Replaceable] BarInfo statusbar;
attribute [Replaceable] BarInfo toolbar;
+ attribute [Replaceable] Navigator navigator;
+ attribute [Replaceable] Navigator clientInformation;
DOMSelection getSelection();
diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp
index 8eec6e0..3a3dc97 100644
--- a/WebCore/page/DragController.cpp
+++ b/WebCore/page/DragController.cpp
@@ -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"
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 3a04f0c..0d75dad 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -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"
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index 28a7bd1..d83cf6d 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -99,6 +99,7 @@
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
index 0000000..2f8aea4
--- /dev/null
+++ b/WebCore/page/Navigator.cpp
@@ -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
index 0000000..d3207f1
--- /dev/null
+++ b/WebCore/page/Navigator.h
@@ -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
index 0000000..9e73a02
--- /dev/null
+++ b/WebCore/page/Navigator.idl
@@ -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();
+ };
+
+}
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index 0eefc07..108ddd2 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -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 @@
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
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index fd5dce5..0cdcb54 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -56,6 +56,7 @@
class InspectorController;
class Node;
class PageGroup;
+ class PluginData;
class ProgressTracker;
class Selection;
class SelectionController;
@@ -72,6 +73,9 @@
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 @@
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
index 1e53184..0000000
--- a/WebCore/page/Plugin.h
+++ /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
diff --git a/WebCore/page/mac/FrameMac.mm b/WebCore/page/mac/FrameMac.mm
index 2060953..0122716 100644
--- a/WebCore/page/mac/FrameMac.mm
+++ b/WebCore/page/mac/FrameMac.mm
@@ -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"
diff --git a/WebCore/page/mac/WebCoreFrameBridge.mm b/WebCore/page/mac/WebCoreFrameBridge.mm
index 453b2eb..da12491 100644
--- a/WebCore/page/mac/WebCoreFrameBridge.mm
+++ b/WebCore/page/mac/WebCoreFrameBridge.mm
@@ -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 @@
if (WebCore::DOMImplementation::isTextMIMEType(mimeType) ||
Image::supportsType(mimeType) ||
- PluginInfoStore::supportsMIMEType(mimeType))
+ (m_frame->page() && m_frame->page()->pluginData()->supportsMimeType(mimeType)))
return NO;
return YES;
diff --git a/WebCore/page/mac/WebCoreViewFactory.h b/WebCore/page/mac/WebCoreViewFactory.h
index 4cf21e3..7d55150 100644
--- a/WebCore/page/mac/WebCoreViewFactory.h
+++ b/WebCore/page/mac/WebCoreViewFactory.h
@@ -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;
diff --git a/WebCore/page/qt/FrameQt.cpp b/WebCore/page/qt/FrameQt.cpp
index 914eedd..06efde5 100644
--- a/WebCore/page/qt/FrameQt.cpp
+++ b/WebCore/page/qt/FrameQt.cpp
@@ -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"
diff --git a/WebCore/page/win/FrameWin.cpp b/WebCore/page/win/FrameWin.cpp
index 11afdde..cb5e518 100644
--- a/WebCore/page/win/FrameWin.cpp
+++ b/WebCore/page/win/FrameWin.cpp
@@ -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"
diff --git a/WebCore/platform/gtk/TemporaryLinkStubs.cpp b/WebCore/platform/gtk/TemporaryLinkStubs.cpp
index f56bf6f..09b5c4b 100644
--- a/WebCore/platform/gtk/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/gtk/TemporaryLinkStubs.cpp
@@ -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 @@
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
index 2776eae..0000000
--- a/WebCore/platform/mac/PlugInInfoStoreMac.mm
+++ /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;
-}
-
-}
-
diff --git a/WebCore/platform/qt/MIMETypeRegistryQt.cpp b/WebCore/platform/qt/MIMETypeRegistryQt.cpp
index 6b3e243..7c8eb18 100644
--- a/WebCore/platform/qt/MIMETypeRegistryQt.cpp
+++ b/WebCore/platform/qt/MIMETypeRegistryQt.cpp
@@ -28,11 +28,6 @@
#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 @@
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
index 0000000..8195a80
--- /dev/null
+++ b/WebCore/plugins/MimeType.cpp
@@ -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
index 0000000..1e067da
--- /dev/null
+++ b/WebCore/plugins/MimeType.h
@@ -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
index 0000000..92cc737
--- /dev/null
+++ b/WebCore/plugins/MimeType.idl
@@ -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
index 0000000..0a9d91f
--- /dev/null
+++ b/WebCore/plugins/MimeTypeArray.cpp
@@ -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
index 0000000..90b4981
--- /dev/null
+++ b/WebCore/plugins/MimeTypeArray.h
@@ -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
index 0000000..4092b08
--- /dev/null
+++ b/WebCore/plugins/MimeTypeArray.idl
@@ -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
index 0000000..31eed39
--- /dev/null
+++ b/WebCore/plugins/Plugin.cpp
@@ -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
index 0000000..01ea312
--- /dev/null
+++ b/WebCore/plugins/Plugin.h
@@ -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
index 0000000..d565e48
--- /dev/null
+++ b/WebCore/plugins/Plugin.idl
@@ -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
index 0000000..3d9cd02
--- /dev/null
+++ b/WebCore/plugins/PluginArray.cpp
@@ -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
index 0000000..41b895d
--- /dev/null
+++ b/WebCore/plugins/PluginArray.h
@@ -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
index 0000000..59cd652
--- /dev/null
+++ b/WebCore/plugins/PluginArray.idl
@@ -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
index 0000000..d2c1ef4
--- /dev/null
+++ b/WebCore/plugins/PluginData.cpp
@@ -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
index 0000000..40e834c
--- /dev/null
+++ b/WebCore/plugins/PluginData.h
@@ -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
index 0000000..eeb9316
--- /dev/null
+++ b/WebCore/plugins/mac/PluginDataMac.mm
@@ -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
index 0000000..75a6dc1
--- /dev/null
+++ b/WebCore/plugins/qt/PluginDataQt.cpp
@@ -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
index 0000000..c3f3f3a
--- /dev/null
+++ b/WebCore/plugins/win/PluginDataWin.cpp
@@ -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();
+}
+
+};
diff --git a/WebKit.pri b/WebKit.pri
index 55de9b3..d12423be 100644
--- a/WebKit.pri
+++ b/WebKit.pri
@@ -97,7 +97,8 @@
$$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 {
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 0fa6277..20923ac 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -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.
diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
index c524b4b..41f3837 100644
--- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm
+++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
@@ -71,22 +71,9 @@
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
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index c954863..5382429 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -361,16 +361,6 @@
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)
diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h
index 81a71d8..6973f2a 100644
--- a/WebKit/mac/WebView/WebFrameInternal.h
+++ b/WebKit/mac/WebView/WebFrameInternal.h
@@ -149,8 +149,6 @@
- (int)_numPendingOrLoadingRequests:(BOOL)recurse;
-- (void)_reloadForPluginChanges;
-
- (void)_attachScriptDebugger;
- (void)_detachScriptDebugger;
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 7bb5d3d..b71749fd 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -1281,11 +1281,6 @@
[NSApp setWindowsNeedUpdate:YES];
}
-- (void)_reloadForPluginChanges
-{
- [[self mainFrame] _reloadForPluginChanges];
-}
-
- (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL
{
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
diff --git a/WebKit/qt/Api/qwebnetworkinterface.cpp b/WebKit/qt/Api/qwebnetworkinterface.cpp
index fd0c694..63121f2 100644
--- a/WebKit/qt/Api/qwebnetworkinterface.cpp
+++ b/WebKit/qt/Api/qwebnetworkinterface.cpp
@@ -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 @@
*/
bool QWebNetworkJob::cancelled() const
{
- return !d->resourceHandle && !d->connector;
+ return !d->resourceHandle;
}
/*!
@@ -450,7 +449,6 @@
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 @@
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 @@
client = job->d->resourceHandle->client();
if (!client)
return;
- } else if (!job->d->connector) {
+ } else {
return;
}
@@ -571,8 +568,6 @@
if (client)
client->didReceiveResponse(job->d->resourceHandle, response);
- if (job->d->connector)
- emit job->d->connector->started(job);
}
@@ -587,7 +582,7 @@
client = job->d->resourceHandle->client();
if (!client)
return;
- } else if (!job->d->connector) {
+ } else {
return;
}
@@ -597,8 +592,6 @@
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 @@
client = job->d->resourceHandle->client();
if (!client)
return;
- } else if (!job->d->connector) {
+ } else {
job->deref();
return;
}
@@ -645,9 +638,6 @@
}
}
- if (job->d->connector)
- emit job->d->connector->finished(job, errorCode);
-
DEBUG() << "receivedFinished done" << job->d->request.url;
job->deref();
diff --git a/WebKit/qt/Api/qwebnetworkinterface_p.h b/WebKit/qt/Api/qwebnetworkinterface_p.h
index c712ae4..9b6f4d0 100644
--- a/WebKit/qt/Api/qwebnetworkinterface_p.h
+++ b/WebKit/qt/Api/qwebnetworkinterface_p.h
@@ -57,7 +57,6 @@
, resourceHandle(0)
, redirected(false)
, interface(0)
- , connector(0)
, jobStatus(QWebNetworkJob::JobCreated)
{}
int ref;
@@ -69,7 +68,6 @@
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
index b24d604..0000000
--- a/WebKit/qt/Api/qwebobjectplugin.cpp
+++ /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 <param> 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
index 3c7caf7..0000000
--- a/WebKit/qt/Api/qwebobjectplugin.h
+++ /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
index e20261f..0000000
--- a/WebKit/qt/Api/qwebobjectplugin_p.h
+++ /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
index f53c164..0000000
--- a/WebKit/qt/Api/qwebobjectpluginconnector.cpp
+++ /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
index 62251a3..0000000
--- a/WebKit/qt/Api/qwebobjectpluginconnector.h
+++ /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
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 6e5e984..4121a41 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -128,6 +128,7 @@
networkInterface = 0;
#else
networkManager = 0;
+ pluginFactory = 0;
#endif
insideOpenCall = false;
@@ -1406,6 +1407,16 @@
return d->networkManager;
}
+void QWebPage::setPluginFactory(QWebPluginFactory *factory)
+{
+ d->pluginFactory = factory;
+}
+
+QWebPluginFactory *QWebPage::pluginFactory() const
+{
+ return d->pluginFactory;
+}
+
#endif
/*!
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index e76f935..8557c31 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -42,6 +42,7 @@
class QWebPagePrivate;
class QWebFrameData;
class QWebNetworkInterface;
+class QWebPluginFactory;
namespace WebCore {
class ChromeClientQt;
@@ -171,6 +172,9 @@
#else
void setNetworkAccessManager(QNetworkAccessManager *manager);
QNetworkAccessManager *networkAccessManager() const;
+
+ void setPluginFactory(QWebPluginFactory *factory);
+ QWebPluginFactory *pluginFactory() const;
#endif
quint64 totalBytes() const;
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 80b1e29..64edd32 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -154,6 +154,10 @@
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
index 0000000..cb5d455
--- /dev/null
+++ b/WebKit/qt/Api/qwebpluginfactory.cpp
@@ -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
index 0000000..e305f5b
--- /dev/null
+++ b/WebKit/qt/Api/qwebpluginfactory.h
@@ -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
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index f777741..0102d8f 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,5 +1,43 @@
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.
* Api/qwebframe.cpp:
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index ed91b86..dda0cee 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -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 @@
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 @@
}
}
- // ### 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);
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 665129b..fbc3b9d 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -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.
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
index 5df8a38..2e4970a 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
@@ -29,6 +29,7 @@
#include "DumpRenderTree.h"
#include "jsobjects.h"
+#include "testplugin.h"
#include <QDir>
#include <QFile>
@@ -87,6 +88,8 @@
settings()->setAttribute(QWebSettings::LinksIncludedInFocusChain, false);
connect(this, SIGNAL(geometryChangeRequest(const QRect &)),
this, SLOT(setViewGeometry(const QRect & )));
+
+ setPluginFactory(new TestPlugin(this));
}
QWebPage *WebPage::createWindow()
diff --git a/WebKitTools/DumpRenderTree/qt/main.cpp b/WebKitTools/DumpRenderTree/qt/main.cpp
index dd4c0e9..738be7f 100644
--- a/WebKitTools/DumpRenderTree/qt/main.cpp
+++ b/WebKitTools/DumpRenderTree/qt/main.cpp
@@ -28,7 +28,6 @@
*/
#include "DumpRenderTree.h"
-#include "testplugin.h"
#include <qstringlist.h>
#include <qapplication.h>
@@ -49,10 +48,6 @@
#include <execinfo.h>
#endif
-#if QT_VERSION < 0x040400
-Q_IMPORT_PLUGIN(testplugin)
-#endif
-
void messageHandler(QtMsgType type, const char *message)
{
if (type == QtCriticalMsg) {
diff --git a/WebKitTools/DumpRenderTree/qt/testplugin.cpp b/WebKitTools/DumpRenderTree/qt/testplugin.cpp
index 27558c9..f3e0399 100644
--- a/WebKitTools/DumpRenderTree/qt/testplugin.cpp
+++ b/WebKitTools/DumpRenderTree/qt/testplugin.cpp
@@ -27,10 +27,8 @@
*/
#include "testplugin.h"
-#if QT_VERSION < 0x040400
-
TestPlugin::TestPlugin(QObject *parent)
- : QWebObjectPlugin(parent)
+ : QWebPluginFactory(parent)
{
}
@@ -38,34 +36,32 @@
{
}
-QStringList TestPlugin::keys() const
+QList<QWebPluginFactory::Plugin> TestPlugin::plugins() const
{
- return QStringList(QLatin1String("testplugin"));
+ QWebPluginFactory::Plugin plugin;
+
+ plugin.name = "testplugin";
+ plugin.description = "testdescription";
+ MimeType mimeType;
+ mimeType.name = "testtype";
+ mimeType.fileExtensions.append("testsuffixes");
+ plugin.mimeTypes.append(mimeType);
+
+ plugin.name = "testplugin2";
+ plugin.description = "testdescription2";
+ mimeType.name = "testtype2";
+ mimeType.fileExtensions.append("testsuffixes2");
+ mimeType.fileExtensions.append("testsuffixes3");
+ plugin.mimeTypes.append(mimeType);
+
+ return QList<QWebPluginFactory::Plugin>() << plugin;
}
-QString TestPlugin::descriptionForKey(const QString &) const
-{
- return QLatin1String("testdescription");
-}
-
-QStringList TestPlugin::mimetypesForKey(const QString &) const
-{
- return QStringList(QLatin1String("testtype"));
-}
-
-QStringList TestPlugin::extensionsForMimetype(const QString &) const
-{
- return QStringList(QLatin1String("testsuffixes"));
-}
-
-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
diff --git a/WebKitTools/DumpRenderTree/qt/testplugin.h b/WebKitTools/DumpRenderTree/qt/testplugin.h
index e305069..ecfd977 100644
--- a/WebKitTools/DumpRenderTree/qt/testplugin.h
+++ b/WebKitTools/DumpRenderTree/qt/testplugin.h
@@ -25,28 +25,21 @@
* (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