Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1169)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 1267103003: Deny the geolocation permission request by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/permission/AwGeolocationCallback.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 8874bd7375ea74006664616fe1e7e41e5c7d1327..e146350fff7061108a08bba14555e391273e7de2 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -37,11 +37,11 @@ import android.view.accessibility.AccessibilityNodeProvider;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
-import android.webkit.GeolocationPermissions;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.widget.OverScroller;
+import org.chromium.android_webview.permission.AwGeolocationCallback;
import org.chromium.android_webview.permission.AwPermissionRequest;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
@@ -2441,25 +2441,13 @@ public class AwContents implements SmartClipProvider,
mContentsClient.onReceivedHttpAuthRequest(handler, host, realm);
}
- private class AwGeolocationCallback implements GeolocationPermissions.Callback {
+ public AwGeolocationPermissions getGeolocationPermissions() {
+ return mBrowserContext.getGeolocationPermissions();
+ }
- @Override
- public void invoke(final String origin, final boolean allow, final boolean retain) {
- ThreadUtils.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- if (retain) {
- if (allow) {
- mBrowserContext.getGeolocationPermissions().allow(origin);
- } else {
- mBrowserContext.getGeolocationPermissions().deny(origin);
- }
- }
- if (isDestroyed()) return;
- nativeInvokeGeolocationCallback(mNativeAwContents, allow, origin);
- }
- });
- }
+ public void invokeGeolocationCallback(boolean value, String requestingFrame) {
+ if (isDestroyed()) return;
+ nativeInvokeGeolocationCallback(mNativeAwContents, value, requestingFrame);
}
@CalledByNative
@@ -2478,7 +2466,7 @@ public class AwContents implements SmartClipProvider,
return;
}
mContentsClient.onGeolocationPermissionsShowPrompt(
- origin, new AwGeolocationCallback());
+ origin, new AwGeolocationCallback(origin, this));
}
@CalledByNative
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/permission/AwGeolocationCallback.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698