Hi all,

I started yesterday working on an implementation for WebKitUIClient's
runOpenPanel() in WebKit2GTK+, and would like to share here the ideas
behind it and the current status of it (aka the patch I have so far).

What I did so far is basically the following:

- Implement runOpenPanel() in WebKitUIClient.cpp, where I create 
  an object of a new class wrapping WKOpenPanelResultListenerRef and
  WKOpenPanelParametersRef, which I named WebKitOpenPanelDecision atm.

- The API for that new WebKitOpenPanelDecision is simple: it provides a 
  allows_multiple_files(), choose_files() and cancel() methods, 
  implemented in terms of the wrapped WKOpenPanelResultListenerRef and
  WKOpenPanelParametersRef attributes.

- Once that object is created, pass it to the webView to emit a new 
  signal from there, including that new object as parameter. At the
  moment, I named that new signal 'decide-open-panel', inspired in the
  'decide-policy' signal. It uses g_signal_accumulator_true_handled.

- Provide a default handler in the webview for this new signal so, if 
  not intercepted from the app, a GtkFileChooserDialog will be run and
  a handler for that dialog's 'response' signal will be installed, to 
  asynchronously handle the result after selecting files/cancelling: it 
  will call webkit_open_panel_decision_cancel() if the dialog was
  cancelled it and webkit_open_panel_decision_choose_files() otherwise.

I'm not quite sure about some parts of this at the moment (e.g. the
names for signals and the new class), but I think this is a good point
to start discussing about it, and see if we can agree on something
before keeping working along this line.

So, I'm attaching the patch I've at the moment for reference and in
order to help with the discussion. Please notice it's not a final patch,
but more kind of a draft :-)

Mario
>From 4a1f7c1525dac9cb4f81c1c198c53a913830d98f Mon Sep 17 00:00:00 2001
From: Mario Sanchez Prada <[email protected]>
Date: Fri, 10 Feb 2012 12:13:59 +0100
Subject: [PATCH] Implement runOpenPanel in WebKit2GTK+

---
 Source/WebKit2/GNUmakefile.am                      |    4 +
 .../UIProcess/API/gtk/WebKitOpenPanelDecision.cpp  |   95 ++++++++++++++++++++
 .../UIProcess/API/gtk/WebKitOpenPanelDecision.h    |   69 ++++++++++++++
 .../API/gtk/WebKitOpenPanelDecisionPrivate.h       |   28 ++++++
 .../WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp   |   13 +++-
 Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp |   64 +++++++++++++
 Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h   |   49 ++++++-----
 .../UIProcess/API/gtk/WebKitWebViewPrivate.h       |    1 +
 8 files changed, 299 insertions(+), 24 deletions(-)
 create mode 100644 Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.cpp
 create mode 100644 Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.h
 create mode 100644 Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecisionPrivate.h

diff --git a/Source/WebKit2/GNUmakefile.am b/Source/WebKit2/GNUmakefile.am
index 2b36ed3..446b1b4 100644
--- a/Source/WebKit2/GNUmakefile.am
+++ b/Source/WebKit2/GNUmakefile.am
@@ -89,6 +89,7 @@ libwebkit2gtkinclude_HEADERS = \
 	$(WebKit2)/UIProcess/API/gtk/WebKitEditingCommands.h \
 	$(WebKit2)/UIProcess/API/gtk/WebKitError.h \
 	$(WebKit2)/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h \
+	$(WebKit2)/UIProcess/API/gtk/WebKitOpenPanelDecision.h \
 	$(WebKit2)/UIProcess/API/gtk/WebKitPolicyDecision.h \
 	$(WebKit2)/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
 	$(WebKit2)/UIProcess/API/gtk/WebKitSettings.h \
@@ -544,6 +545,9 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOU
 	Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp \
 	Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h \
 	Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h \
+	Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.cpp \
+	Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.h \
+	Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecisionPrivate.h \
 	Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp \
 	Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.h \
 	Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h \
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.cpp
new file mode 100644
index 0000000..ce168d4
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.cpp
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * 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 "WebKitOpenPanelDecision.h"
+
+#include "APIObject.h"
+#include "FileSystem.h"
+#include "ImmutableArray.h"
+#include "WKOpenPanelResultListener.h"
+#include "WKOpenPanelParameters.h"
+#include "WebKitOpenPanelDecisionPrivate.h"
+#include "WebKitPrivate.h"
+
+using namespace WebKit;
+
+/**
+ * SECTION: WebKitOpenPanelDecision
+ * @Short_description: An open panel decision
+ * @Title: WebKitOpenPanelDecision
+ * @See_also: #WebKitWebView
+ */
+G_DEFINE_TYPE(WebKitOpenPanelDecision, webkit_open_panel_decision, G_TYPE_OBJECT)
+
+struct _WebKitOpenPanelDecisionPrivate {
+    WKRetainPtr<WKOpenPanelParametersRef> parameters;
+    WKRetainPtr<WKOpenPanelResultListenerRef> listener;
+};
+
+static void webkit_open_panel_decision_init(WebKitOpenPanelDecision* decision)
+{
+    decision->priv = G_TYPE_INSTANCE_GET_PRIVATE(decision, WEBKIT_TYPE_OPEN_PANEL_DECISION, WebKitOpenPanelDecisionPrivate);
+    new (decision->priv) WebKitOpenPanelDecisionPrivate();
+}
+
+static void webkitOpenPanelDecisionFinalize(GObject* object)
+{
+     WebKitOpenPanelDecisionPrivate* priv = WEBKIT_OPEN_PANEL_DECISION(object)->priv;
+    priv->~WebKitOpenPanelDecisionPrivate();
+    G_OBJECT_CLASS(webkit_open_panel_decision_parent_class)->finalize(object);
+}
+
+static void webkit_open_panel_decision_class_init(WebKitOpenPanelDecisionClass* decisionClass)
+{
+    GObjectClass* objectClass = G_OBJECT_CLASS(decisionClass);
+    objectClass->finalize = webkitOpenPanelDecisionFinalize;
+    g_type_class_add_private(decisionClass, sizeof(WebKitOpenPanelDecisionPrivate));
+}
+
+WebKitOpenPanelDecision* webkitOpenPanelDecisionCreate(WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener)
+{
+    WebKitOpenPanelDecision* decision = WEBKIT_OPEN_PANEL_DECISION(g_object_new(WEBKIT_TYPE_OPEN_PANEL_DECISION, NULL));
+    decision->priv->parameters = parameters;
+    decision->priv->listener = listener;
+    return decision;
+}
+
+gboolean webkit_open_panel_decision_allows_multiple_files(WebKitOpenPanelDecision* decision)
+{
+    return WKOpenPanelParametersGetAllowsMultipleFiles(decision->priv->parameters.get());
+}
+
+void webkit_open_panel_decision_choose_files(WebKitOpenPanelDecision* decision, GSList* fileUris)
+{
+    Vector<RefPtr<APIObject> > selectedUris;
+    int i = 0;
+    for (GSList* item = fileUris ; item ; item = item->next) {
+        if (!item->data)
+            continue;
+        selectedUris.append(WebURL::create(WebCore::filenameToString(static_cast<char*>(item->data))));
+    }
+
+    WKOpenPanelResultListenerChooseFiles(decision->priv->listener.get(), toAPI(ImmutableArray::adopt(selectedUris).get()));
+}
+
+void webkit_open_panel_decision_cancel (WebKitOpenPanelDecision* decision)
+{
+    WKOpenPanelResultListenerCancel(decision->priv->listener.get());
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.h b/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.h
new file mode 100644
index 0000000..651d6c2
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecision.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * 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.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WebKitOpenPanelDecision_h
+#define WebKitOpenPanelDecision_h
+
+#include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_OPEN_PANEL_DECISION            (webkit_open_panel_decision_get_type())
+#define WEBKIT_OPEN_PANEL_DECISION(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_OPEN_PANEL_DECISION, WebKitOpenPanelDecision))
+#define WEBKIT_OPEN_PANEL_DECISION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_OPEN_PANEL_DECISION, WebKitOpenPanelDecisionClass))
+#define WEBKIT_IS_OPEN_PANEL_DECISION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_OPEN_PANEL_DECISION))
+#define WEBKIT_IS_OPEN_PANEL_DECISION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_OPEN_PANEL_DECISION))
+#define WEBKIT_OPEN_PANEL_DECISION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_OPEN_PANEL_DECISION, WebKitOpenPanelDecisionClass))
+
+typedef struct _WebKitOpenPanelDecision        WebKitOpenPanelDecision;
+typedef struct _WebKitOpenPanelDecisionClass   WebKitOpenPanelDecisionClass;
+typedef struct _WebKitOpenPanelDecisionPrivate WebKitOpenPanelDecisionPrivate;
+
+struct _WebKitOpenPanelDecision {
+    GObject parent;
+
+    /*< private >*/
+    WebKitOpenPanelDecisionPrivate *priv;
+};
+
+struct _WebKitOpenPanelDecisionClass {
+    GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_open_panel_decision_get_type              (void);
+
+WEBKIT_API gboolean
+webkit_open_panel_decision_allows_multiple_files (WebKitOpenPanelDecision*);
+
+WEBKIT_API void
+webkit_open_panel_decision_choose_files          (WebKitOpenPanelDecision*,
+                                                  GSList*);
+
+WEBKIT_API void
+webkit_open_panel_decision_cancel                (WebKitOpenPanelDecision*);
+
+G_END_DECLS
+
+#endif
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecisionPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecisionPrivate.h
new file mode 100644
index 0000000..46950b9
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitOpenPanelDecisionPrivate.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * 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 WebKitOpenPanelDecisionPrivate_h
+#define WebKitOpenPanelDecisionPrivate_h
+
+#include "WebKitOpenPanelDecision.h"
+#include <WebKit2/WebKit2.h>
+
+WebKitOpenPanelDecision* webkitOpenPanelDecisionCreate(WKOpenPanelParametersRef, WKOpenPanelResultListenerRef);
+
+#endif // WebKitOpenPanelDecisionPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
index a659ad3..a051eaa 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
@@ -20,12 +20,17 @@
 #include "config.h"
 #include "WebKitUIClient.h"
 
+#include "WKOpenPanelParameters.h"
+#include "WebKitOpenPanelDecision.h"
+#include "WebKitOpenPanelDecisionPrivate.h"
 #include "WebKitPrivate.h"
 #include "WebKitWebViewBasePrivate.h"
 #include "WebKitWebViewPrivate.h"
 #include "WebKitWindowPropertiesPrivate.h"
 #include "WebPageProxy.h"
 #include <WebCore/GtkUtilities.h>
+#include <glib/gi18n-lib.h>
+#include <wtf/gobject/GRefPtr.h>
 
 using namespace WebKit;
 
@@ -126,6 +131,12 @@ static void setWindowFrame(WKPageRef page, WKRect frame, const void* clientInfo)
     webkitWindowPropertiesSetGeometry(windowProperties, &geometry);
 }
 
+static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void *clientInfo)
+{
+    GRefPtr<WebKitOpenPanelDecision> decision = adoptGRef(webkitOpenPanelDecisionCreate(parameters, listener));
+    webkitWebViewMakeOpenPanelDecision(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_OPEN_PANEL_DECISION(decision.get()));
+}
+
 void attachUIClientToView(WebKitWebView* webView)
 {
     WKPageUIClient wkUIClient = {
@@ -159,7 +170,7 @@ void attachUIClientToView(WebKitWebView* webView)
         0, // didDraw
         0, // pageDidScroll
         0, // exceededDatabaseQuota
-        0, // runOpenPanel
+        runOpenPanel,
         0, // decidePolicyForGeolocationPermissionRequest
         0, // headerHeight
         0, // footerHeight
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
index c3acccc..21a7a16 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
@@ -21,6 +21,8 @@
 #include "config.h"
 #include "WebKitWebView.h"
 
+#include "FileSystem.h"
+#include "GOwnPtr.h"
 #include "WebKitBackForwardListPrivate.h"
 #include "WebKitEnumTypes.h"
 #include "WebKitError.h"
@@ -58,6 +60,7 @@ enum {
     SCRIPT_PROMPT,
 
     DECIDE_POLICY,
+    DECIDE_OPEN_PANEL,
 
     LAST_SIGNAL
 };
@@ -154,6 +157,49 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision*
     return TRUE;
 }
 
+static void fileChooserDialogResponseCallback(GtkDialog* dialog, gint responseID, WebKitOpenPanelDecision* decision)
+{
+    if (responseID == GTK_RESPONSE_ACCEPT) {
+        GSList* fileUris = NULL;
+        if (gtk_file_chooser_get_select_multiple(GTK_FILE_CHOOSER(dialog))) {
+            fileUris = gtk_file_chooser_get_uris(GTK_FILE_CHOOSER(dialog));
+        } else {
+            gchar* fileUri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog));
+            if (!fileUri)
+                fileUris = g_slist_append(fileUris, fileUri);
+        }
+        webkit_open_panel_decision_choose_files(decision, fileUris);
+        g_slist_foreach(fileUris, reinterpret_cast<GFunc>(g_free), 0);
+        g_slist_free(fileUris);
+
+    } else
+        webkit_open_panel_decision_cancel(decision);
+
+    g_object_unref(decision);
+
+    gtk_widget_destroy(GTK_WIDGET(dialog));
+}
+
+static gboolean webkitWebViewDecideOpenPanel(WebKitWebView* webView, WebKitOpenPanelDecision* decision)
+{
+    GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(webView));
+    if (!WebCore::widgetIsOnscreenToplevelWindow(toplevel))
+        toplevel = 0;
+
+    GtkWidget* dialog = gtk_file_chooser_dialog_new(_("Upload File"),
+                                                    toplevel ? GTK_WINDOW(toplevel) : 0,
+                                                    GTK_FILE_CHOOSER_ACTION_OPEN,
+                                                    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                                                    GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+                                                    NULL);
+
+    gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), webkit_open_panel_decision_allows_multiple_files(decision));
+    g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(fileChooserDialogResponseCallback), g_object_ref(decision));
+    gtk_widget_show(dialog);
+
+    return TRUE;
+}
+
 static void webkitWebViewConstructed(GObject* object)
 {
     if (G_OBJECT_CLASS(webkit_web_view_parent_class)->constructed)
@@ -257,6 +303,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
     webViewClass->script_confirm = webkitWebViewScriptConfirm;
     webViewClass->script_prompt = webkitWebViewScriptPrompt;
     webViewClass->decide_policy = webkitWebViewDecidePolicy;
+    webViewClass->decide_open_panel = webkitWebViewDecideOpenPanel;
 
     g_type_class_add_private(webViewClass, sizeof(WebKitWebViewPrivate));
 
@@ -615,6 +662,17 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
                      G_TYPE_BOOLEAN, 2, /* number of parameters */
                      WEBKIT_TYPE_POLICY_DECISION,
                      WEBKIT_TYPE_POLICY_DECISION_TYPE);
+
+    /* TODO: Describe the signal. */
+    signals[DECIDE_OPEN_PANEL] =
+        g_signal_new("decide-open-panel",
+                     G_TYPE_FROM_CLASS(webViewClass),
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET(WebKitWebViewClass, decide_open_panel),
+                     g_signal_accumulator_true_handled, 0 /* accumulator data */,
+                     webkit_marshal_BOOLEAN__OBJECT,
+                     G_TYPE_BOOLEAN, 1, /* number of parameters */
+                     WEBKIT_TYPE_OPEN_PANEL_DECISION);
 }
 
 void webkitWebViewLoadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent)
@@ -726,6 +784,12 @@ void webkitWebViewMakePolicyDecision(WebKitWebView* webView, WebKitPolicyDecisio
     g_signal_emit(webView, signals[DECIDE_POLICY], 0, decision, type, &returnValue);
 }
 
+void webkitWebViewMakeOpenPanelDecision(WebKitWebView* webView, WebKitOpenPanelDecision* decision)
+{
+    gboolean returnValue;
+    g_signal_emit(webView, signals[DECIDE_OPEN_PANEL], 0, decision, &returnValue);
+}
+
 /**
  * webkit_web_view_new:
  *
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
index d4768e3..47dd0f7 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
@@ -35,6 +35,7 @@
 #include <webkit2/WebKitURIRequest.h>
 #include <webkit2/WebKitWebViewBase.h>
 #include <webkit2/WebKitWindowProperties.h>
+#include <webkit2/WebKitOpenPanelDecision.h>
 #include <webkit2/WebKitPolicyDecision.h>
 
 G_BEGIN_DECLS
@@ -116,29 +117,31 @@ struct _WebKitWebView {
 struct _WebKitWebViewClass {
     WebKitWebViewBaseClass parent;
 
-    void       (* load_changed)   (WebKitWebView             *web_view,
-                                   WebKitLoadEvent            load_event);
-    gboolean   (* load_failed)    (WebKitWebView             *web_view,
-                                   WebKitLoadEvent            load_event,
-                                   const gchar               *failing_uri,
-                                   GError                    *error);
-
-    GtkWidget *(* create)         (WebKitWebView             *web_view);
-    void       (* ready_to_show)  (WebKitWebView             *web_view);
-    void       (* close)          (WebKitWebView             *web_view);
-
-    gboolean   (* script_alert)   (WebKitWebView             *web_view,
-                                   const gchar               *message);
-    gboolean   (* script_confirm) (WebKitWebView             *web_view,
-                                   const gchar               *message,
-                                   gboolean                  *confirmed);
-    gboolean   (* script_prompt)  (WebKitWebView             *web_view,
-                                   const gchar               *message,
-                                   const gchar               *default_text,
-                                   gchar                    **text);
-    gboolean   (* decide_policy)  (WebKitWebView             *web_view,
-                                   WebKitPolicyDecision      *decision,
-                                   WebKitPolicyDecisionType  type);
+    void       (* load_changed)     (WebKitWebView             *web_view,
+                                     WebKitLoadEvent            load_event);
+    gboolean   (* load_failed)      (WebKitWebView             *web_view,
+                                     WebKitLoadEvent            load_event,
+                                     const gchar               *failing_uri,
+                                     GError                    *error);
+
+    GtkWidget *(* create)           (WebKitWebView             *web_view);
+    void       (* ready_to_show)    (WebKitWebView             *web_view);
+    void       (* close)            (WebKitWebView             *web_view);
+
+    gboolean   (* script_alert)     (WebKitWebView             *web_view,
+                                     const gchar               *message);
+    gboolean   (* script_confirm)   (WebKitWebView             *web_view,
+                                     const gchar               *message,
+                                     gboolean                  *confirmed);
+    gboolean   (* script_prompt)    (WebKitWebView             *web_view,
+                                     const gchar               *message,
+                                     const gchar               *default_text,
+                                     gchar                    **text);
+    gboolean   (* decide_policy)     (WebKitWebView            *web_view,
+                                      WebKitPolicyDecision     *decision,
+                                      WebKitPolicyDecisionType  type);
+    gboolean   (* decide_open_panel) (WebKitWebView            *web_view,
+                                      WebKitOpenPanelDecision  *decision);
 
     /* Padding for future expansion */
     void (*_webkit_reserved0) (void);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
index 66386d0..40c8889 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
@@ -43,5 +43,6 @@ void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message);
 bool webkitWebViewRunJavaScriptConfirm(WebKitWebView*, const CString& message);
 WKStringRef webkitWebViewRunJavaScriptPrompt(WebKitWebView*, const CString& message, const CString& defaultText);
 void webkitWebViewMakePolicyDecision(WebKitWebView*, WebKitPolicyDecisionType, WebKitPolicyDecision*);
+void webkitWebViewMakeOpenPanelDecision(WebKitWebView*, WebKitOpenPanelDecision*);
 
 #endif // WebKitWebViewPrivate_h
-- 
1.7.7.5

_______________________________________________
webkit-gtk mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk

Reply via email to