[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
andersca at apple.com
andersca at apple.com
Tue Jan 5 23:54:19 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 90ca6fa26efb88c044b650acc6fcb7c9510ba3a7
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 18 21:43:36 2009 +0000
Add WKPCRunSyncOpenPanel implementation.
Reviewed by Sam Weinig.
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WKPCRunSyncOpenPanel):
* Plugins/Hosted/WebKitPluginClient.defs:
* Plugins/Hosted/WebKitPluginHost.defs:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index f7438b0..dd91c78 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -2,6 +2,17 @@
Reviewed by Sam Weinig.
+ Add WKPCRunSyncOpenPanel implementation.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WKPCRunSyncOpenPanel):
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ * Plugins/Hosted/WebKitPluginHost.defs:
+
+2009-12-18 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
Add a useProxiedOpenPanel WebPreference and tunnel it through to the plug-in host.
* Plugins/Hosted/NetscapePluginHostManager.h:
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
index 970f5f5..c3bd6a7 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
@@ -1058,4 +1058,55 @@ kern_return_t WKPCResolveURL(mach_port_t clientPort, uint32_t pluginID, data_t u
return KERN_SUCCESS;
}
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+kern_return_t WKPCRunSyncOpenPanel(mach_port_t clientPort, data_t panelData, mach_msg_type_number_t panelDataLength)
+{
+ DataDeallocator panelDataDeallocator(panelData, panelDataLength);
+
+ NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
+ if (!hostProxy)
+ return KERN_FAILURE;
+
+ NSOpenPanel *sheet = [NSOpenPanel openPanel];
+ NSDictionary *panelState = [NSPropertyListSerialization propertyListFromData:[NSData dataWithBytes:panelData length:panelDataLength]
+ mutabilityOption:NSPropertyListImmutable
+ format:NULL
+ errorDescription:nil];
+
+ [sheet setCanChooseFiles:[[panelState objectForKey:@"canChooseFiles"] boolValue]];
+ [sheet setCanChooseDirectories:[[panelState objectForKey:@"canChooseDirectories"] boolValue]];
+ [sheet setResolvesAliases:[[panelState objectForKey:@"resolvesAliases"] boolValue]];
+ [sheet setAllowsMultipleSelection:[[panelState objectForKey:@"allowsMultipleSelection"] boolValue]];
+ [sheet setCanCreateDirectories:[[panelState objectForKey:@"canCreateDirectories"] boolValue]];
+ [sheet setShowsHiddenFiles:[[panelState objectForKey:@"showsHiddenFiles"] boolValue]];
+ [sheet setExtensionHidden:[[panelState objectForKey:@"isExtensionHidden"] boolValue]];
+ [sheet setCanSelectHiddenExtension:[[panelState objectForKey:@"canSelectHiddenExtension"] boolValue]];
+ [sheet setAllowsOtherFileTypes:[[panelState objectForKey:@"allowsOtherFileTypes"] boolValue]];
+ [sheet setTreatsFilePackagesAsDirectories:[[panelState objectForKey:@"treatsFilePackagesAsDirectories"] boolValue]];
+ [sheet setPrompt:[panelState objectForKey:@"prompt"]];
+ [sheet setNameFieldLabel:[panelState objectForKey:@"nameFieldLabel"]];
+ [sheet setMessage:[panelState objectForKey:@"message"]];
+ [sheet setAllowedFileTypes:[panelState objectForKey:@"allowedFileTypes"]];
+ [sheet setRequiredFileType:[panelState objectForKey:@"requiredFileType"]];
+ [sheet setTitle:[panelState objectForKey:@"title"]];
+ [sheet runModal];
+
+ NSDictionary *ret = [NSDictionary dictionaryWithObjectsAndKeys:
+ [sheet filenames], @"filenames",
+ WKNoteOpenPanelFiles([sheet filenames]), @"extensions",
+ nil];
+
+ RetainPtr<NSData*> data = [NSPropertyListSerialization dataFromPropertyList:ret format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
+ ASSERT(data);
+
+ _WKPHSyncOpenPanelReply(hostProxy->port(), const_cast<char *>(static_cast<const char*>([data.get() bytes])), [data.get() length]);
+ return KERN_SUCCESS;
+}
+#else
+kern_return_t WKPCRunSyncOpenPanel(mach_port_t clientPort, data_t panelData, mach_msg_type_number_t panelDataLength)
+{
+ return KERN_FAILURE;
+}
+#endif // !defined(BUILDING_ON_SNOW_LEOPARD)
+
#endif // USE(PLUGIN_HOST_PROCESS)
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
index 9877d9e..e3fb3d7 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
@@ -206,7 +206,7 @@ routine PCResolveURL(clientPort :mach_port_t;
url :data_t;
target :data_t;
out resolvedURL :data_t, dealloc);
-
+
// Replies
simpleroutine PCInstantiatePluginReply(clientPort :mach_port_t;
pluginID :uint32_t;
@@ -224,9 +224,12 @@ simpleroutine PCBooleanReply(clientPort :mach_port_t;
pluginID :uint32_t;
requestID :uint32_t;
result :boolean_t);
-
+
simpleroutine PCBooleanAndDataReply(clientPort :mach_port_t;
pluginID :uint32_t;
requestID :uint32_t;
returnValue :boolean_t;
result :data_t);
+
+simpleroutine PCRunSyncOpenPanel(clientPort :mach_port_t;
+ panelData :data_t);
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
index 9882bb5..c7cec89 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
@@ -240,4 +240,5 @@ simpleroutine PHPluginInstancePrivateBrowsingModeDidChange(pluginHostPort :mach_
pluginID :uint32_t;
privateBrowsingEnabled :boolean_t);
-
+simpleroutine PHSyncOpenPanelReply(pluginHostPort :mach_port_t;
+ filenames :data_t);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list