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

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

Issue 1882783002: [WebView] Disallow geolocation on insecure origins for apps targeting N and higher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Torne's comment Created 4 years, 8 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
Index: android_webview/java/src/org/chromium/android_webview/AwSettings.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwSettings.java b/android_webview/java/src/org/chromium/android_webview/AwSettings.java
index a7f1afdb548f7774045c11f98f9c3292ebb438e2..07eaaeab23f10b17271ffc1e749834e397abfd62 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwSettings.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwSettings.java
@@ -97,6 +97,7 @@ public class AwSettings {
private final boolean mSupportLegacyQuirks;
private final boolean mAllowEmptyDocumentPersistence;
+ private final boolean mAllowGeolocationOnInsecureOrigins;
private final boolean mPasswordEchoEnabled;
@@ -210,7 +211,8 @@ public class AwSettings {
public AwSettings(Context context,
boolean isAccessFromFileURLsGrantedByDefault,
boolean supportsLegacyQuirks,
- boolean allowEmptyDocumentPersistence) {
+ boolean allowEmptyDocumentPersistence,
+ boolean allowGeolocationOnInsecureOrigins) {
boolean hasInternetPermission = context.checkPermission(
android.Manifest.permission.INTERNET,
Process.myPid(),
@@ -240,6 +242,7 @@ public class AwSettings {
mSupportLegacyQuirks = supportsLegacyQuirks;
mAllowEmptyDocumentPersistence = allowEmptyDocumentPersistence;
+ mAllowGeolocationOnInsecureOrigins = allowGeolocationOnInsecureOrigins;
}
// Defer initializing the native side until a native WebContents instance is set.
}
@@ -1255,6 +1258,12 @@ public class AwSettings {
return mAllowEmptyDocumentPersistence;
}
+ @CalledByNative
+ private boolean getAllowGeolocationOnInsecureOrigins() {
+ assert Thread.holdsLock(mAwSettingsLock);
+ return mAllowGeolocationOnInsecureOrigins;
+ }
+
/**
* See {@link android.webkit.WebSettings#setUseWideViewPort}.
*/

Powered by Google App Engine
This is Rietveld 408576698