| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |