Replace geopolicyrequested() with permissionrequested()
The permission-request signal can now ask for than a geolocation authorisation (though we only handle that for now).
This commit is contained in:
parent
42c6c90366
commit
92d7ba7ed8
1 changed files with 15 additions and 11 deletions
22
surf.c
22
surf.c
|
@ -130,8 +130,8 @@ static void die(const char *errstr, ...);
|
||||||
static void eval(Client *c, const Arg *arg);
|
static void eval(Client *c, const Arg *arg);
|
||||||
static void find(Client *c, const Arg *arg);
|
static void find(Client *c, const Arg *arg);
|
||||||
static void fullscreen(Client *c, const Arg *arg);
|
static void fullscreen(Client *c, const Arg *arg);
|
||||||
static void geopolicyrequested(WebKitWebView *v, WebKitWebFrame *f,
|
static gboolean permissionrequested(WebKitWebView *v,
|
||||||
WebKitGeolocationPolicyDecision *d, Client *c);
|
WebKitPermissionRequest *r, Client *c);
|
||||||
static const char *getatom(Client *c, int a);
|
static const char *getatom(Client *c, int a);
|
||||||
static void gettogglestat(Client *c);
|
static void gettogglestat(Client *c);
|
||||||
static void getpagestat(Client *c);
|
static void getpagestat(Client *c);
|
||||||
|
@ -527,14 +527,18 @@ fullscreen(Client *c, const Arg *arg)
|
||||||
c->fullscreen = !c->fullscreen;
|
c->fullscreen = !c->fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
geopolicyrequested(WebKitWebView *v, WebKitWebFrame *f,
|
permissionrequested(WebKitWebView *v, WebKitPermissionRequest *r, Client *c)
|
||||||
WebKitGeolocationPolicyDecision *d, Client *c)
|
|
||||||
{
|
{
|
||||||
|
if (WEBKIT_IS_GEOLOCATION_PERMISSION_REQUEST(r)) {
|
||||||
if (allowgeolocation)
|
if (allowgeolocation)
|
||||||
webkit_geolocation_policy_allow(d);
|
webkit_permission_request_allow(r);
|
||||||
else
|
else
|
||||||
webkit_geolocation_policy_deny(d);
|
webkit_permission_request_deny(r);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -883,8 +887,8 @@ newview(Client *c, WebKitWebView *rv)
|
||||||
"mouse-target-changed",
|
"mouse-target-changed",
|
||||||
G_CALLBACK(mousetargetchanged), c);
|
G_CALLBACK(mousetargetchanged), c);
|
||||||
g_signal_connect(G_OBJECT(v),
|
g_signal_connect(G_OBJECT(v),
|
||||||
"geolocation-policy-decision-requested",
|
"permission-request",
|
||||||
G_CALLBACK(geopolicyrequested), c);
|
G_CALLBACK(permissionrequested), c);
|
||||||
g_signal_connect(G_OBJECT(v),
|
g_signal_connect(G_OBJECT(v),
|
||||||
"create-web-view",
|
"create-web-view",
|
||||||
G_CALLBACK(createwindow), c);
|
G_CALLBACK(createwindow), c);
|
||||||
|
|
Loading…
Reference in a new issue