[webkit-gtk] Implement runOpenPanel in WebKit2GTK+

Mario Sanchez Prada msanchez at igalia.com
Mon Feb 13 10:06:17 PST 2012


On Mon, 2012-02-13 at 11:12 -0200, Gustavo Noronha Silva wrote:
> +1 on Carlos' API suggestions

Thank you for all the provided feedback (including Martin's here as
well). I have already incorporated all of these suggestions in my local
branch and have filed a new bug to properly tracking work done on this:

https://bugs.webkit.org/show_bug.cgi?id=78491

If everything goes fine, tomorrow I'll work on properly documenting (and
polishing) the code, as well as writing unit tests for this new API,
which at the moment is looking like this:

>From WebKitFileChooserRequest.h:
================================
gboolean
webkit_file_chooser_request_allows_multiple_files(WebKitFileChooserRequest*);

gchar**
webkit_file_chooser_request_accepted_mime_types(WebKitFileChooserRequest*);

GtkFileFilter*
webkit_file_chooser_request_get_file_filter(WebKitFileChooserRequest*);

void
webkit_file_chooser_request_choose_files(WebKitFileChooserRequest*, 
                                         GSList*);
gchar**
webkit_file_chooser_request_selected_files(WebKitFileChooserRequest*);

void
webkit_file_chooser_request_cancel(WebKitFileChooserRequest*);


>From WebKitWebView.h:
=====================

[...]
gboolean (* run_file_chooser) (WebKitWebView            *web_view,
                               WebKitFileChooserRequest *request);
[...]


As you can see I added an _accepted_mime_types() function besides the
one suggested by Carlos (_get_file_filter()), because I thought under
some scenarios it could be interesting to have easy access to the list
of accepted mime types (as in an array of char*), and extracting that
list from a GtkFileFilter instance is not trivial at all.

Again, attaching the new patch together with this mail for you to be
able to take a look if interested, just bear in mind is not a final one
(new functions not even tested, will do while writing the unit tests).

Thanks,
Mario
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Implement-runOpenPanel-in-WebKit2GTK.patch
Type: text/x-patch
Size: 21410 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20120213/4b330a8b/attachment.bin>


More information about the webkit-gtk mailing list