mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add a new CefGetGeolocation function for retrieving geolocation information via an API callback (issue #764).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@871 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -178,7 +178,7 @@ void CefGeolocationClient::requestPermission(
|
||||
DCHECK(CefThread::CurrentlyOn(CefThread::UI));
|
||||
|
||||
int bridge_id = pending_permissions_->add(permissionRequest);
|
||||
string16 origin = permissionRequest.securityOrigin().toString();
|
||||
GURL origin = GURL(permissionRequest.securityOrigin().toString());
|
||||
|
||||
CefRefPtr<CefClient> client = browser_->GetClient();
|
||||
if (client.get()) {
|
||||
@@ -188,8 +188,8 @@ void CefGeolocationClient::requestPermission(
|
||||
CefRefPtr<CefGeolocationCallbackImpl> callbackPtr(
|
||||
new CefGeolocationCallbackImpl(this, bridge_id));
|
||||
|
||||
handler->OnRequestGeolocationPermission(browser_, origin, bridge_id,
|
||||
callbackPtr.get());
|
||||
handler->OnRequestGeolocationPermission(browser_, origin.spec(),
|
||||
bridge_id, callbackPtr.get());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -205,14 +205,16 @@ void CefGeolocationClient::cancelPermissionRequest(
|
||||
int bridge_id;
|
||||
if (!pending_permissions_->remove(permissionRequest, bridge_id))
|
||||
return;
|
||||
string16 origin = permissionRequest.securityOrigin().toString();
|
||||
GURL origin = GURL(permissionRequest.securityOrigin().toString());
|
||||
|
||||
CefRefPtr<CefClient> client = browser_->GetClient();
|
||||
if (client.get()) {
|
||||
CefRefPtr<CefGeolocationHandler> handler =
|
||||
client->GetGeolocationHandler();
|
||||
if (handler.get())
|
||||
handler->OnCancelGeolocationPermission(browser_, origin, bridge_id);
|
||||
if (handler.get()) {
|
||||
handler->OnCancelGeolocationPermission(browser_, origin.spec(),
|
||||
bridge_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user