summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2015-11-18 18:09:55 +0100
committerQuentin Rameau <quinq@fifth.space>2015-11-20 00:34:20 +0100
commit92d7ba7ed8cf4cb7ffa839596fca58032e2c4dd3 (patch)
treeb7faa298ccbb163bf365d6047d57c898f88507aa
parent42c6c90366b7ce7708b13037a6ba819b08fbb20e (diff)
downloadsurf-92d7ba7ed8cf4cb7ffa839596fca58032e2c4dd3.tar.gz
surf-92d7ba7ed8cf4cb7ffa839596fca58032e2c4dd3.tar.bz2
surf-92d7ba7ed8cf4cb7ffa839596fca58032e2c4dd3.zip
Replace geopolicyrequested() with permissionrequested()
The permission-request signal can now ask for than a geolocation authorisation (though we only handle that for now).
-rw-r--r--surf.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/surf.c b/surf.c
index af994bb..c9a036a 100644
--- a/surf.c
+++ b/surf.c
@@ -130,8 +130,8 @@ static void die(const char *errstr, ...);
static void eval(Client *c, const Arg *arg);
static void find(Client *c, const Arg *arg);
static void fullscreen(Client *c, const Arg *arg);
-static void geopolicyrequested(WebKitWebView *v, WebKitWebFrame *f,
- WebKitGeolocationPolicyDecision *d, Client *c);
+static gboolean permissionrequested(WebKitWebView *v,
+ WebKitPermissionRequest *r, Client *c);
static const char *getatom(Client *c, int a);
static void gettogglestat(Client *c);
static void getpagestat(Client *c);
@@ -527,14 +527,18 @@ fullscreen(Client *c, const Arg *arg)
c->fullscreen = !c->fullscreen;
}
-void
-geopolicyrequested(WebKitWebView *v, WebKitWebFrame *f,
- WebKitGeolocationPolicyDecision *d, Client *c)
+gboolean
+permissionrequested(WebKitWebView *v, WebKitPermissionRequest *r, Client *c)
{
- if (allowgeolocation)
- webkit_geolocation_policy_allow(d);
- else
- webkit_geolocation_policy_deny(d);
+ if (WEBKIT_IS_GEOLOCATION_PERMISSION_REQUEST(r)) {
+ if (allowgeolocation)
+ webkit_permission_request_allow(r);
+ else
+ webkit_permission_request_deny(r);
+ return TRUE;
+ }
+
+ return FALSE;
}
const char *
@@ -883,8 +887,8 @@ newview(Client *c, WebKitWebView *rv)
"mouse-target-changed",
G_CALLBACK(mousetargetchanged), c);
g_signal_connect(G_OBJECT(v),
- "geolocation-policy-decision-requested",
- G_CALLBACK(geopolicyrequested), c);
+ "permission-request",
+ G_CALLBACK(permissionrequested), c);
g_signal_connect(G_OBJECT(v),
"create-web-view",
G_CALLBACK(createwindow), c);