2010-03-02 Arno Renevier <arno@renevier.net>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Mar 2010 01:27:25 +0000 (01:27 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Mar 2010 01:27:25 +0000 (01:27 +0000)
        Reviewed by Gustavo Noronha Silva.

        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
        https://bugs.webkit.org/show_bug.cgi?id=35210

        * GNUmakefile.am:
2010-03-02  Arno Renevier  <arno@renevier.net>

        Reviewed by Gustavo Noronha Silva.

        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
        https://bugs.webkit.org/show_bug.cgi?id=35210

        * platform/gtk/Skipped:
2010-03-02  Arno Renevier  <arno@renevier.net>

        Reviewed by Gustavo Noronha Silva.

        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
        https://bugs.webkit.org/show_bug.cgi?id=35210

        * WebCoreSupport/ChromeClientGtk.cpp:
        * WebCoreSupport/ChromeClientGtk.h:
        * docs/webkitgtk-sections.txt:
        * webkit/webkit.h:
        * webkit/webkitdefines.h:
        * webkit/webkitgeolocationpolicydecision.cpp: Added.
        (webkit_geolocation_policy_decision_class_init):
        (webkit_geolocation_policy_decision_init):
        (webkit_geolocation_policy_decision_new):
        (webkit_geolocation_policy_allow):
        (webkit_geolocation_policy_deny):
        * webkit/webkitgeolocationpolicydecision.h: Added.
        * webkit/webkitprivate.h:
        * webkit/webkitwebview.cpp:
        (DNDContentsRequest::webkit_web_view_class_init):
        * webkitmarshal.list:
2010-03-02  Arno Renevier  <arno@renevier.net>

        Reviewed by Gustavo Noronha Silva.

        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
        https://bugs.webkit.org/show_bug.cgi?id=35210

        * DumpRenderTree/gtk/DumpRenderTree.cpp:
        (geolocationPolicyDecisionRequested):
        (createWebView):

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

18 files changed:
ChangeLog
GNUmakefile.am
LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
WebKit/gtk/docs/webkitgtk-docs.sgml
WebKit/gtk/docs/webkitgtk-sections.txt
WebKit/gtk/webkit/webkit.h
WebKit/gtk/webkit/webkitdefines.h
WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp [new file with mode: 0644]
WebKit/gtk/webkit/webkitgeolocationpolicydecision.h [new file with mode: 0644]
WebKit/gtk/webkit/webkitprivate.h
WebKit/gtk/webkit/webkitwebview.cpp
WebKit/gtk/webkitmarshal.list
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp

index c475a19..63bfd52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-03-02  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=35210
+
+        * GNUmakefile.am:
+
 2010-03-02  Dmitry Titov  <dimich@chromium.org>
 
         Reviewed by Alexey Proskuryakov.
index 854a1b0..5a25554 100644 (file)
@@ -327,6 +327,7 @@ webkitgtk_h_api += \
        $(srcdir)/WebKit/gtk/webkit/webkitwebinspector.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebnavigationaction.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebpolicydecision.h \
+       $(srcdir)/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebwindowfeatures.h \
@@ -375,6 +376,7 @@ webkitgtk_sources += \
        WebKit/gtk/webkit/webkitwebinspector.cpp \
        WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
        WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
+       WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
        WebKit/gtk/webkit/webkitwebresource.cpp \
        WebKit/gtk/webkit/webkitwebdatabase.cpp \
        WebKit/gtk/webkit/webkitsecurityorigin.cpp \
index 62b68cf..858c7d5 100644 (file)
@@ -1,3 +1,12 @@
+2010-03-02  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=35210
+
+        * platform/gtk/Skipped:
+
 2010-03-02  Andy Estes  <aestes@apple.com>
 
         Reviewed by Maciej Stachowiak.
index 266efdb..5071e9d 100644 (file)
@@ -1285,16 +1285,11 @@ fast/dom/frame-loading-via-document-write.html
 fast/dom/Geolocation/callback-exception.html
 fast/dom/Geolocation/error.html
 fast/dom/Geolocation/permission-denied-already-clear-watch.html
-fast/dom/Geolocation/permission-denied-already-error.html
-fast/dom/Geolocation/permission-denied-already-success.html
-fast/dom/Geolocation/permission-denied-stops-watches.html
-fast/dom/Geolocation/permission-denied.html
 fast/dom/Geolocation/position-string.html
 fast/dom/Geolocation/reentrant-error.html
 fast/dom/Geolocation/reentrant-success.html
 fast/dom/Geolocation/success.html
 fast/dom/Geolocation/timeout-clear-watch.html
-fast/dom/Geolocation/timeout-zero.html
 fast/dom/Geolocation/timeout.html
 fast/dom/Geolocation/watch.html
 fast/dom/Element/getBoundingClientRect.html
index 3b100be..cca66d8 100644 (file)
@@ -1,3 +1,27 @@
+2010-03-02  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=35210
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        * WebCoreSupport/ChromeClientGtk.h:
+        * docs/webkitgtk-sections.txt:
+        * webkit/webkit.h:
+        * webkit/webkitdefines.h:
+        * webkit/webkitgeolocationpolicydecision.cpp: Added.
+        (webkit_geolocation_policy_decision_class_init):
+        (webkit_geolocation_policy_decision_init):
+        (webkit_geolocation_policy_decision_new):
+        (webkit_geolocation_policy_allow):
+        (webkit_geolocation_policy_deny):
+        * webkit/webkitgeolocationpolicydecision.h: Added.
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebview.cpp:
+        (DNDContentsRequest::webkit_web_view_class_init):
+        * webkitmarshal.list:
+
 2010-03-01  José Millán Soto  <jmillan@igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
index d4cce8a..1bfc7e2 100644 (file)
@@ -33,6 +33,7 @@
 #include "CString.h"
 #include "HitTestResult.h"
 #include "KURL.h"
+#include "webkitgeolocationpolicydecision.h"
 #include "webkitwebview.h"
 #include "webkitnetworkrequest.h"
 #include "webkitprivate.h"
@@ -575,10 +576,24 @@ bool ChromeClient::setCursor(PlatformCursorHandle)
     return false;
 }
 
-void ChromeClient::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
+void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
 {
-    // See the comment in WebCore/page/ChromeClient.h
-    notImplemented();
+    WebKitWebFrame* webFrame = kit(frame);
+    WebKitWebView* webView = getViewFromFrame(webFrame);
+
+    WebKitGeolocationPolicyDecision* policyDecision = webkit_geolocation_policy_decision_new(webFrame, geolocation);
+
+    gboolean isHandled = FALSE;
+    g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision, &isHandled);
+    if (!isHandled)
+        webkit_geolocation_policy_deny(policyDecision);
+}
+
+void ChromeClient::cancelGeolocationPermissionRequestForFrame(WebCore::Frame* frame)
+{
+    WebKitWebFrame* webFrame = kit(frame);
+    WebKitWebView* webView = getViewFromFrame(webFrame);
+    g_signal_emit_by_name(webView, "geolocation-policy-decision-cancelled", webFrame);
 }
 
 }
index 62d48fa..6139b3a 100644 (file)
@@ -117,7 +117,7 @@ namespace WebKit {
 
         virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const {}
         virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
-        virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*) { }
+        virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*);
 
     private:
         WebKitWebView* m_webView;
index 77f3482..6c84dcb 100644 (file)
@@ -18,6 +18,7 @@
     <xi:include href="xml/webkitwebhistoryitem.xml"/>
     <xi:include href="xml/webkitwebnavigationaction.xml"/>
     <xi:include href="xml/webkitwebpolicydecision.xml"/>
+    <xi:include href="xml/webkitgeolocationpolicydecision.xml"/>
     <xi:include href="xml/webkitnetworkrequest.xml"/>
     <xi:include href="xml/webkitnetworkresponse.xml"/>
     <xi:include href="xml/webkitwebinspector.xml"/>
index 2379c8b..14124a1 100644 (file)
@@ -351,6 +351,25 @@ WebKitWebPolicyDecisionPrivate
 </SECTION>
 
 <SECTION>
+<FILE>webkitgeolocationpolicydecision</FILE>
+<TITLE>WebKitGeolocationPolicyDecision</TITLE>
+WebKitGeolocationPolicyDecision
+webkit_geolocation_policy_allow
+webkit_geolocation_policy_deny
+<SUBSECTION Standard>
+WEBKIT_IS_GEOLOCATION_POLICY_DECISION
+WEBKIT_IS_GEOLOCATION_POLICY_DECISION_CLASS
+WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION
+WEBKIT_GEOLOCATION_POLICY_DECISION
+WEBKIT_GEOLOCATION_POLICY_DECISION_CLASS
+WEBKIT_GEOLOCATION_POLICY_DECISION_GET_CLASS
+<SUBSECTION Private>
+WebKitGeolocationPolicyDecision
+WebKitGeolocationPolicyDecisionClass
+WebKitGeolocationPolicyDecisionPrivate
+</SECTION>
+
+<SECTION>
 <FILE>webkitnetworkrequest</FILE>
 <TITLE>WebKitNetworkRequest</TITLE>
 WebKitNetworkRequest
index 4cd0709..17b197b 100644 (file)
@@ -24,6 +24,7 @@
 #include <webkit/webkitversion.h>
 #include <webkit/webkitdefines.h>
 #include <webkit/webkitdownload.h>
+#include <webkit/webkitgeolocationpolicydecision.h>
 #include <webkit/webkithittestresult.h>
 #include <webkit/webkitnetworkrequest.h>
 #include <webkit/webkitnetworkresponse.h>
index a5884f3..b06a3bf 100644 (file)
@@ -89,6 +89,9 @@ typedef struct _WebKitSecurityOriginClass WebKitSecurityOriginClass;
 typedef struct _WebKitHitTestResult WebKitHitTestResult;
 typedef struct _WebKitHitTestResultClass WebKitHitTestResultClass;
 
+typedef struct _WebKitGeolocationPolicyDecision WebKitGeolocationPolicyDecision;
+typedef struct _WebKitGeolocationPolicyDecisionClass WebKitGeolocationPolicyDecisionClass;
+
 G_END_DECLS
 
 #endif
diff --git a/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp b/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp
new file mode 100644 (file)
index 0000000..7afd8fa
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2010 Arno Renevier
+ *
+ * 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 "webkitgeolocationpolicydecision.h"
+
+#include "webkitprivate.h"
+#include "Geolocation.h"
+
+using namespace WebKit;
+using namespace WebCore;
+
+/**
+ * SECTION:webkitgeolocationpolicydecision
+ * @short_description: Liaison between WebKit and the application regarding asynchronous geolocation policy decisions
+ *
+ * #WebKitGeolocationPolicyDecision objects are given to the application when
+ * geolocation-policy-decision-requested signal is emitted. The application
+ * uses it to tell the engine whether it wants to allow or deny geolocation for
+ * a given frame.
+ */
+
+G_DEFINE_TYPE(WebKitGeolocationPolicyDecision, webkit_geolocation_policy_decision, G_TYPE_OBJECT);
+
+struct _WebKitGeolocationPolicyDecisionPrivate {
+    WebKitWebFrame* frame;
+    Geolocation* geolocation;
+};
+
+#define WEBKIT_GEOLOCATION_POLICY_DECISION_GET_PRIVATE(obj)    (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionPrivate))
+
+static void webkit_geolocation_policy_decision_class_init(WebKitGeolocationPolicyDecisionClass* decisionClass)
+{
+    g_type_class_add_private(decisionClass, sizeof(WebKitGeolocationPolicyDecisionPrivate));
+}
+
+static void webkit_geolocation_policy_decision_init(WebKitGeolocationPolicyDecision* decision)
+{
+    decision->priv = WEBKIT_GEOLOCATION_POLICY_DECISION_GET_PRIVATE(decision);
+}
+
+WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame* frame, Geolocation* geolocation)
+{
+    g_return_val_if_fail(frame, NULL);
+    WebKitGeolocationPolicyDecision* decision = WEBKIT_GEOLOCATION_POLICY_DECISION(g_object_new(WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, NULL));
+    WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv;
+
+    priv->frame = frame;
+    priv->geolocation = geolocation;
+    return decision;
+}
+
+/**
+ * webkit_geolocation_policy_allow
+ * @decision: a #WebKitGeolocationPolicyDecision
+ *
+ * Will send the allow decision to the policy implementer.
+ *
+ * Since: 1.1.23
+ */
+void webkit_geolocation_policy_allow(WebKitGeolocationPolicyDecision* decision)
+{
+    g_return_if_fail(WEBKIT_IS_GEOLOCATION_POLICY_DECISION(decision));
+
+    WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv;
+    priv->geolocation->setIsAllowed(TRUE);
+}
+
+/**
+ * webkit_geolocation_policy_deny
+ * @decision: a #WebKitGeolocationPolicyDecision
+ *
+ * Will send the deny decision to the policy implementer.
+ *
+ * Since: 1.1.23
+ */
+void webkit_geolocation_policy_deny(WebKitGeolocationPolicyDecision* decision)
+{
+    g_return_if_fail(WEBKIT_IS_GEOLOCATION_POLICY_DECISION(decision));
+
+    WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv;
+    priv->geolocation->setIsAllowed(FALSE);
+}
+
diff --git a/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h b/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h
new file mode 100644 (file)
index 0000000..27e0ef2
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Arno Renevier
+ *
+ * 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 webkitgeolocationpolicydecision_h
+#define webkitgeolocationpolicydecision_h
+
+#include <glib-object.h>
+#include <webkit/webkitdefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION            (webkit_geolocation_policy_decision_get_type())
+#define WEBKIT_GEOLOCATION_POLICY_DECISION(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecision))
+#define WEBKIT_GEOLOCATION_POLICY_DECISION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionClass))
+#define WEBKIT_IS_GEOLOCATION_POLICY_DECISION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION))
+#define WEBKIT_IS_GEOLOCATION_POLICY_DECISION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION))
+#define WEBKIT_GEOLOCATION_POLICY_DECISION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionClass))
+
+typedef struct _WebKitGeolocationPolicyDecisionPrivate WebKitGeolocationPolicyDecisionPrivate;
+struct _WebKitGeolocationPolicyDecision {
+    GObject parent_instance;
+
+    /*< private >*/
+    WebKitGeolocationPolicyDecisionPrivate* priv;
+};
+
+struct _WebKitGeolocationPolicyDecisionClass {
+    GObjectClass parent_class;
+
+    /* Padding for future expansion */
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+};
+
+WEBKIT_API GType
+webkit_geolocation_policy_decision_get_type (void);
+
+WEBKIT_API void
+webkit_geolocation_policy_allow (WebKitGeolocationPolicyDecision* decision);
+
+WEBKIT_API void
+webkit_geolocation_policy_deny (WebKitGeolocationPolicyDecision* decision);
+
+G_END_DECLS
+
+#endif
index 74861be..065e55d 100644 (file)
@@ -49,6 +49,7 @@
 #include "CString.h"
 #include <enchant.h>
 #include "GOwnPtr.h"
+#include "Geolocation.h"
 #include "HistoryItem.h"
 #include "Settings.h"
 #include "Page.h"
@@ -271,6 +272,9 @@ extern "C" {
     WebKitNetworkResponse*
     webkit_network_response_new_with_core_response(const WebCore::ResourceResponse& resourceResponse);
 
+    WebKitGeolocationPolicyDecision*
+    webkit_geolocation_policy_decision_new(WebKitWebFrame*, WebCore::Geolocation*);
+
     // FIXME: move this to webkitnetworkrequest.h once the API is agreed upon.
     WEBKIT_API SoupMessage*
     webkit_network_request_get_message(WebKitNetworkRequest* request);
index 671271f..9a39a7a 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "webkitdownload.h"
 #include "webkitenumtypes.h"
+#include "webkitgeolocationpolicydecision.h"
 #include "webkitmarshal.h"
 #include "webkitnetworkrequest.h"
 #include "webkitnetworkresponse.h"
@@ -159,6 +160,8 @@ enum {
     DATABASE_QUOTA_EXCEEDED,
     RESOURCE_REQUEST_STARTING,
     DOCUMENT_LOAD_FINISHED,
+    GEOLOCATION_POLICY_DECISION_REQUESTED,
+    GEOLOCATION_POLICY_DECISION_CANCELLED,
     LAST_SIGNAL
 };
 
@@ -2212,6 +2215,48 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
             WEBKIT_TYPE_NETWORK_REQUEST,
             WEBKIT_TYPE_NETWORK_RESPONSE);
 
+    /**
+     * WebKitWebView::geolocation-policy-decision-requested:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the frame that requests permission
+     * @policy_decision: a WebKitGeolocationPolicyDecision
+     *
+     * When a @frame wants to get its geolocation permission.
+     * The receiver must reply with a boolean wether it handled or not the
+     * request. If the request is not handled, default behaviour is to deny
+     * geolocation.
+     *
+     * Since: 1.1.23
+     */
+    webkit_web_view_signals[GEOLOCATION_POLICY_DECISION_REQUESTED] = g_signal_new("geolocation-policy-decision-requested",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST),
+            0,
+            NULL, NULL,
+            webkit_marshal_BOOLEAN__OBJECT_OBJECT,
+            G_TYPE_BOOLEAN, 2,
+            WEBKIT_TYPE_WEB_FRAME,
+            WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION);
+
+    /**
+     * WebKitWebView::geolocation-policy-decision-cancelled:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the frame that cancels geolocation request.
+     *
+     * When a @frame wants to cancel geolocation permission it had requested
+     * before.
+     *
+     * Since: 1.1.23
+     */
+    webkit_web_view_signals[GEOLOCATION_POLICY_DECISION_REQUESTED] = g_signal_new("geolocation-policy-decision-cancelled",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST),
+            0,
+            NULL, NULL,
+            g_cclosure_marshal_VOID__OBJECT,
+            G_TYPE_NONE, 1,
+            WEBKIT_TYPE_WEB_FRAME);
+
     /*
      * DOM-related signals. These signals are experimental, for now,
      * and may change API and ABI. Their comments lack one * on
index fefdff3..d8caa4c 100644 (file)
@@ -1,6 +1,7 @@
 BOOLEAN:ENUM,INT
 BOOLEAN:INT,INT,STRING
 BOOLEAN:OBJECT
+BOOLEAN:OBJECT,OBJECT
 BOOLEAN:OBJECT,OBJECT,OBJECT,OBJECT
 BOOLEAN:OBJECT,OBJECT,STRING,OBJECT
 BOOLEAN:OBJECT,STRING
index 8b25bd0..235770a 100644 (file)
@@ -1,3 +1,14 @@
+2010-03-02  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=35210
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (geolocationPolicyDecisionRequested):
+        (createWebView):
+
 2010-03-02  Dirk Pranke  <dpranke@chromium.org>
 
         Reviewed by David Levin.
index 7480d85..3ebad44 100644 (file)
@@ -736,6 +736,19 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We
     webkit_security_origin_set_web_database_quota(origin, 5 * 1024 * 1024);
 }
 
+static bool
+geolocationPolicyDecisionRequested(WebKitWebView*, WebKitWebFrame*, WebKitGeolocationPolicyDecision* decision)
+{
+    if (!gLayoutTestController->isGeolocationPermissionSet())
+        return FALSE;
+    if (gLayoutTestController->geolocationPermission())
+        webkit_geolocation_policy_allow(decision);
+    else
+        webkit_geolocation_policy_deny(decision);
+
+    return TRUE;
+}
+
 
 static WebKitWebView* webViewCreate(WebKitWebView*, WebKitWebFrame*);
 
@@ -787,6 +800,7 @@ static WebKitWebView* createWebView()
                      "signal::close-web-view", webViewClose, 0,
                      "signal::database-quota-exceeded", databaseQuotaExceeded, 0,
                      "signal::document-load-finished", webViewDocumentLoadFinished, 0,
+                     "signal::geolocation-policy-decision-requested", geolocationPolicyDecisionRequested, 0,
                      NULL);
 
     WebKitWebInspector* inspector = webkit_web_view_get_inspector(view);