summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tim Volodine <timvolodine@google.com> 2015-03-24 18:18:16 +0000
committer Tim Volodine <timvolodine@google.com> 2015-03-25 12:12:37 +0000
commit954d1333c478d4dba6c9a0536510da4fd94c0622 (patch)
tree395ae5868e63836cb0bd059a6edabc7900508e3f
parented7cfb67e7e697e544ac1220170af741e9e117d6 (diff)
Invoke geolocation permissions callback with denied state by default.
For apps that use WebView but don't override WebChromeClient.onGeolocationPermissionsShowPrompt the callback should be invoked with allow set to false by default. This ensures that the error handler callback in JavaScript is invoked in this case (with the "User denied Geolocation" error). Currently no callbacks are invoked at all by default (see http://crbug.com/470500). Change-Id: I49664906b8cfa6910106c8da1b21b99628adacfc
-rw-r--r--core/java/android/webkit/WebChromeClient.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java
index 4737e9be3f99..0b18bb8c4dde 100644
--- a/core/java/android/webkit/WebChromeClient.java
+++ b/core/java/android/webkit/WebChromeClient.java
@@ -284,13 +284,19 @@ public class WebChromeClient {
* currently set for that origin. The host application should invoke the
* specified callback with the desired permission state. See
* {@link GeolocationPermissions} for details.
+ *
+ * If this method isn't overridden, the callback is invoked with permission
+ * denied state.
+ *
* @param origin The origin of the web content attempting to use the
* Geolocation API.
* @param callback The callback to use to set the permission state for the
* origin.
*/
public void onGeolocationPermissionsShowPrompt(String origin,
- GeolocationPermissions.Callback callback) {}
+ GeolocationPermissions.Callback callback) {
+ callback.invoke(origin, false, false);
+ }
/**
* Notify the host application that a request for Geolocation permissions,