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

Side by Side Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.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 unified diff | Download patch
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwSettings.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package com.android.webview.chromium; 5 package com.android.webview.chromium;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.app.assist.AssistStructure.ViewNode; 9 import android.app.assist.AssistStructure.ViewNode;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } else if (!mFactory.hasStarted()) { 228 } else if (!mFactory.hasStarted()) {
229 if (Looper.myLooper() == Looper.getMainLooper()) { 229 if (Looper.myLooper() == Looper.getMainLooper()) {
230 mFactory.startYourEngines(true); 230 mFactory.startYourEngines(true);
231 } 231 }
232 } 232 }
233 233
234 final boolean isAccessFromFileURLsGrantedByDefault = 234 final boolean isAccessFromFileURLsGrantedByDefault =
235 mAppTargetSdkVersion < Build.VERSION_CODES.JELLY_BEAN; 235 mAppTargetSdkVersion < Build.VERSION_CODES.JELLY_BEAN;
236 final boolean areLegacyQuirksEnabled = mAppTargetSdkVersion < Build.VERS ION_CODES.KITKAT; 236 final boolean areLegacyQuirksEnabled = mAppTargetSdkVersion < Build.VERS ION_CODES.KITKAT;
237 final boolean allowEmptyDocumentPersistence = mAppTargetSdkVersion <= Bu ild.VERSION_CODES.M; 237 final boolean allowEmptyDocumentPersistence = mAppTargetSdkVersion <= Bu ild.VERSION_CODES.M;
238 final boolean allowGeolocationOnInsecureOrigins =
239 mAppTargetSdkVersion <= Build.VERSION_CODES.M;
238 240
239 mContentsClientAdapter = 241 mContentsClientAdapter =
240 new WebViewContentsClientAdapter(mWebView, mContext, mFactory.ge tWebViewDelegate()); 242 new WebViewContentsClientAdapter(mWebView, mContext, mFactory.ge tWebViewDelegate());
241 mWebSettings = new ContentSettingsAdapter( 243 mWebSettings = new ContentSettingsAdapter(
242 new AwSettings(mContext, isAccessFromFileURLsGrantedByDefault, 244 new AwSettings(mContext, isAccessFromFileURLsGrantedByDefault,
243 areLegacyQuirksEnabled, allowEmptyDocumentPersistence)); 245 areLegacyQuirksEnabled, allowEmptyDocumentPersistence,
246 allowGeolocationOnInsecureOrigins));
244 247
245 if (mAppTargetSdkVersion < Build.VERSION_CODES.LOLLIPOP) { 248 if (mAppTargetSdkVersion < Build.VERSION_CODES.LOLLIPOP) {
246 // Prior to Lollipop we always allowed third party cookies and mixed content. 249 // Prior to Lollipop we always allowed third party cookies and mixed content.
247 mWebSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_AL LOW); 250 mWebSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_AL LOW);
248 mWebSettings.setAcceptThirdPartyCookies(true); 251 mWebSettings.setAcceptThirdPartyCookies(true);
249 mWebSettings.getAwSettings().setZeroLayoutHeightDisablesViewportQuir k(true); 252 mWebSettings.getAwSettings().setZeroLayoutHeightDisablesViewportQuir k(true);
250 } 253 }
251 254
252 mRunQueue.addTask(new Runnable() { 255 mRunQueue.addTask(new Runnable() {
253 @Override 256 @Override
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2361 mAwContents.extractSmartClipData(x, y, width, height); 2364 mAwContents.extractSmartClipData(x, y, width, height);
2362 } 2365 }
2363 2366
2364 // Implements SmartClipProvider 2367 // Implements SmartClipProvider
2365 @Override 2368 @Override
2366 public void setSmartClipResultHandler(final Handler resultHandler) { 2369 public void setSmartClipResultHandler(final Handler resultHandler) {
2367 checkThread(); 2370 checkThread();
2368 mAwContents.setSmartClipResultHandler(resultHandler); 2371 mAwContents.setSmartClipResultHandler(resultHandler);
2369 } 2372 }
2370 } 2373 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwSettings.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698