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:
Marshall Greenblatt
2012-10-19 19:52:07 +00:00
parent e45ff9e838
commit 21c2b1ecdd
19 changed files with 775 additions and 16 deletions

View File

@@ -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);
}
}
}