Changeset 55444 in webkit


Ignore:
Timestamp:
Mar 2, 2010 5:27:25 PM (14 years ago)
Author:
eric@webkit.org
Message:

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 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):
Location:
trunk
Files:
2 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r55418 r55444  
     12010-03-02  Arno Renevier  <arno@renevier.net>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
     6        https://bugs.webkit.org/show_bug.cgi?id=35210
     7
     8        * GNUmakefile.am:
     9
    1102010-03-02  Dmitry Titov  <dimich@chromium.org>
    211
  • trunk/GNUmakefile.am

    r55173 r55444  
    328328        $(srcdir)/WebKit/gtk/webkit/webkitwebnavigationaction.h \
    329329        $(srcdir)/WebKit/gtk/webkit/webkitwebpolicydecision.h \
     330        $(srcdir)/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \
    330331        $(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \
    331332        $(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \
     
    376377        WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
    377378        WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
     379        WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
    378380        WebKit/gtk/webkit/webkitwebresource.cpp \
    379381        WebKit/gtk/webkit/webkitwebdatabase.cpp \
  • trunk/LayoutTests/ChangeLog

    r55436 r55444  
     12010-03-02  Arno Renevier  <arno@renevier.net>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
     6        https://bugs.webkit.org/show_bug.cgi?id=35210
     7
     8        * platform/gtk/Skipped:
     9
    1102010-03-02  Andy Estes  <aestes@apple.com>
    211
  • trunk/LayoutTests/platform/gtk/Skipped

    r55405 r55444  
    12861286fast/dom/Geolocation/error.html
    12871287fast/dom/Geolocation/permission-denied-already-clear-watch.html
    1288 fast/dom/Geolocation/permission-denied-already-error.html
    1289 fast/dom/Geolocation/permission-denied-already-success.html
    1290 fast/dom/Geolocation/permission-denied-stops-watches.html
    1291 fast/dom/Geolocation/permission-denied.html
    12921288fast/dom/Geolocation/position-string.html
    12931289fast/dom/Geolocation/reentrant-error.html
     
    12951291fast/dom/Geolocation/success.html
    12961292fast/dom/Geolocation/timeout-clear-watch.html
    1297 fast/dom/Geolocation/timeout-zero.html
    12981293fast/dom/Geolocation/timeout.html
    12991294fast/dom/Geolocation/watch.html
  • trunk/WebKit/gtk/ChangeLog

    r55389 r55444  
     12010-03-02  Arno Renevier  <arno@renevier.net>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
     6        https://bugs.webkit.org/show_bug.cgi?id=35210
     7
     8        * WebCoreSupport/ChromeClientGtk.cpp:
     9        * WebCoreSupport/ChromeClientGtk.h:
     10        * docs/webkitgtk-sections.txt:
     11        * webkit/webkit.h:
     12        * webkit/webkitdefines.h:
     13        * webkit/webkitgeolocationpolicydecision.cpp: Added.
     14        (webkit_geolocation_policy_decision_class_init):
     15        (webkit_geolocation_policy_decision_init):
     16        (webkit_geolocation_policy_decision_new):
     17        (webkit_geolocation_policy_allow):
     18        (webkit_geolocation_policy_deny):
     19        * webkit/webkitgeolocationpolicydecision.h: Added.
     20        * webkit/webkitprivate.h:
     21        * webkit/webkitwebview.cpp:
     22        (DNDContentsRequest::webkit_web_view_class_init):
     23        * webkitmarshal.list:
     24
    1252010-03-01  José Millán Soto  <jmillan@igalia.com>
    226
  • trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r55378 r55444  
    3434#include "HitTestResult.h"
    3535#include "KURL.h"
     36#include "webkitgeolocationpolicydecision.h"
    3637#include "webkitwebview.h"
    3738#include "webkitnetworkrequest.h"
     
    576577}
    577578
    578 void ChromeClient::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
    579 {
    580     // See the comment in WebCore/page/ChromeClient.h
    581     notImplemented();
    582 }
    583 
    584 }
     579void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
     580{
     581    WebKitWebFrame* webFrame = kit(frame);
     582    WebKitWebView* webView = getViewFromFrame(webFrame);
     583
     584    WebKitGeolocationPolicyDecision* policyDecision = webkit_geolocation_policy_decision_new(webFrame, geolocation);
     585
     586    gboolean isHandled = FALSE;
     587    g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision, &isHandled);
     588    if (!isHandled)
     589        webkit_geolocation_policy_deny(policyDecision);
     590}
     591
     592void ChromeClient::cancelGeolocationPermissionRequestForFrame(WebCore::Frame* frame)
     593{
     594    WebKitWebFrame* webFrame = kit(frame);
     595    WebKitWebView* webView = getViewFromFrame(webFrame);
     596    g_signal_emit_by_name(webView, "geolocation-policy-decision-cancelled", webFrame);
     597}
     598
     599}
  • trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h

    r55136 r55444  
    118118        virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const {}
    119119        virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
    120         virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*) { }
     120        virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*);
    121121
    122122    private:
  • trunk/WebKit/gtk/docs/webkitgtk-docs.sgml

    r54260 r55444  
    1919    <xi:include href="xml/webkitwebnavigationaction.xml"/>
    2020    <xi:include href="xml/webkitwebpolicydecision.xml"/>
     21    <xi:include href="xml/webkitgeolocationpolicydecision.xml"/>
    2122    <xi:include href="xml/webkitnetworkrequest.xml"/>
    2223    <xi:include href="xml/webkitnetworkresponse.xml"/>
  • trunk/WebKit/gtk/docs/webkitgtk-sections.txt

    r54959 r55444  
    349349WebKitWebPolicyDecisionClass
    350350WebKitWebPolicyDecisionPrivate
     351</SECTION>
     352
     353<SECTION>
     354<FILE>webkitgeolocationpolicydecision</FILE>
     355<TITLE>WebKitGeolocationPolicyDecision</TITLE>
     356WebKitGeolocationPolicyDecision
     357webkit_geolocation_policy_allow
     358webkit_geolocation_policy_deny
     359<SUBSECTION Standard>
     360WEBKIT_IS_GEOLOCATION_POLICY_DECISION
     361WEBKIT_IS_GEOLOCATION_POLICY_DECISION_CLASS
     362WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION
     363WEBKIT_GEOLOCATION_POLICY_DECISION
     364WEBKIT_GEOLOCATION_POLICY_DECISION_CLASS
     365WEBKIT_GEOLOCATION_POLICY_DECISION_GET_CLASS
     366<SUBSECTION Private>
     367WebKitGeolocationPolicyDecision
     368WebKitGeolocationPolicyDecisionClass
     369WebKitGeolocationPolicyDecisionPrivate
    351370</SECTION>
    352371
  • trunk/WebKit/gtk/webkit/webkit.h

    r48505 r55444  
    2525#include <webkit/webkitdefines.h>
    2626#include <webkit/webkitdownload.h>
     27#include <webkit/webkitgeolocationpolicydecision.h>
    2728#include <webkit/webkithittestresult.h>
    2829#include <webkit/webkitnetworkrequest.h>
  • trunk/WebKit/gtk/webkit/webkitdefines.h

    r49168 r55444  
    9090typedef struct _WebKitHitTestResultClass WebKitHitTestResultClass;
    9191
     92typedef struct _WebKitGeolocationPolicyDecision WebKitGeolocationPolicyDecision;
     93typedef struct _WebKitGeolocationPolicyDecisionClass WebKitGeolocationPolicyDecisionClass;
     94
    9295G_END_DECLS
    9396
  • trunk/WebKit/gtk/webkit/webkitprivate.h

    r55222 r55444  
    5050#include <enchant.h>
    5151#include "GOwnPtr.h"
     52#include "Geolocation.h"
    5253#include "HistoryItem.h"
    5354#include "Settings.h"
     
    272273    webkit_network_response_new_with_core_response(const WebCore::ResourceResponse& resourceResponse);
    273274
     275    WebKitGeolocationPolicyDecision*
     276    webkit_geolocation_policy_decision_new(WebKitWebFrame*, WebCore::Geolocation*);
     277
    274278    // FIXME: move this to webkitnetworkrequest.h once the API is agreed upon.
    275279    WEBKIT_API SoupMessage*
  • trunk/WebKit/gtk/webkit/webkitwebview.cpp

    r55389 r55444  
    3232#include "webkitdownload.h"
    3333#include "webkitenumtypes.h"
     34#include "webkitgeolocationpolicydecision.h"
    3435#include "webkitmarshal.h"
    3536#include "webkitnetworkrequest.h"
     
    160161    RESOURCE_REQUEST_STARTING,
    161162    DOCUMENT_LOAD_FINISHED,
     163    GEOLOCATION_POLICY_DECISION_REQUESTED,
     164    GEOLOCATION_POLICY_DECISION_CANCELLED,
    162165    LAST_SIGNAL
    163166};
     
    22122215            WEBKIT_TYPE_NETWORK_REQUEST,
    22132216            WEBKIT_TYPE_NETWORK_RESPONSE);
     2217
     2218    /**
     2219     * WebKitWebView::geolocation-policy-decision-requested:
     2220     * @web_view: the object on which the signal is emitted
     2221     * @frame: the frame that requests permission
     2222     * @policy_decision: a WebKitGeolocationPolicyDecision
     2223     *
     2224     * When a @frame wants to get its geolocation permission.
     2225     * The receiver must reply with a boolean wether it handled or not the
     2226     * request. If the request is not handled, default behaviour is to deny
     2227     * geolocation.
     2228     *
     2229     * Since: 1.1.23
     2230     */
     2231    webkit_web_view_signals[GEOLOCATION_POLICY_DECISION_REQUESTED] = g_signal_new("geolocation-policy-decision-requested",
     2232            G_TYPE_FROM_CLASS(webViewClass),
     2233            (GSignalFlags)(G_SIGNAL_RUN_LAST),
     2234            0,
     2235            NULL, NULL,
     2236            webkit_marshal_BOOLEAN__OBJECT_OBJECT,
     2237            G_TYPE_BOOLEAN, 2,
     2238            WEBKIT_TYPE_WEB_FRAME,
     2239            WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION);
     2240
     2241    /**
     2242     * WebKitWebView::geolocation-policy-decision-cancelled:
     2243     * @web_view: the object on which the signal is emitted
     2244     * @frame: the frame that cancels geolocation request.
     2245     *
     2246     * When a @frame wants to cancel geolocation permission it had requested
     2247     * before.
     2248     *
     2249     * Since: 1.1.23
     2250     */
     2251    webkit_web_view_signals[GEOLOCATION_POLICY_DECISION_REQUESTED] = g_signal_new("geolocation-policy-decision-cancelled",
     2252            G_TYPE_FROM_CLASS(webViewClass),
     2253            (GSignalFlags)(G_SIGNAL_RUN_LAST),
     2254            0,
     2255            NULL, NULL,
     2256            g_cclosure_marshal_VOID__OBJECT,
     2257            G_TYPE_NONE, 1,
     2258            WEBKIT_TYPE_WEB_FRAME);
    22142259
    22152260    /*
  • trunk/WebKit/gtk/webkitmarshal.list

    r48118 r55444  
    22BOOLEAN:INT,INT,STRING
    33BOOLEAN:OBJECT
     4BOOLEAN:OBJECT,OBJECT
    45BOOLEAN:OBJECT,OBJECT,OBJECT,OBJECT
    56BOOLEAN:OBJECT,OBJECT,STRING,OBJECT
  • trunk/WebKitTools/ChangeLog

    r55439 r55444  
     12010-03-02  Arno Renevier  <arno@renevier.net>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
     6        https://bugs.webkit.org/show_bug.cgi?id=35210
     7
     8        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     9        (geolocationPolicyDecisionRequested):
     10        (createWebView):
     11
    1122010-03-02  Dirk Pranke  <dpranke@chromium.org>
    213
  • trunk/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r55316 r55444  
    737737}
    738738
     739static bool
     740geolocationPolicyDecisionRequested(WebKitWebView*, WebKitWebFrame*, WebKitGeolocationPolicyDecision* decision)
     741{
     742    if (!gLayoutTestController->isGeolocationPermissionSet())
     743        return FALSE;
     744    if (gLayoutTestController->geolocationPermission())
     745        webkit_geolocation_policy_allow(decision);
     746    else
     747        webkit_geolocation_policy_deny(decision);
     748
     749    return TRUE;
     750}
     751
    739752
    740753static WebKitWebView* webViewCreate(WebKitWebView*, WebKitWebFrame*);
     
    788801                     "signal::database-quota-exceeded", databaseQuotaExceeded, 0,
    789802                     "signal::document-load-finished", webViewDocumentLoadFinished, 0,
     803                     "signal::geolocation-policy-decision-requested", geolocationPolicyDecisionRequested, 0,
    790804                     NULL);
    791805
Note: See TracChangeset for help on using the changeset viewer.