Chromium Code Reviews| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 checkThread(); | 227 checkThread(); |
| 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; | |
|
boliu
2016/04/05 17:53:49
is this safe?
sgurun-gerrit only
2016/04/05 18:24:15
I think that is the best we can do at the moment.A
| |
| 237 | 238 |
| 238 mContentsClientAdapter = | 239 mContentsClientAdapter = |
| 239 new WebViewContentsClientAdapter(mWebView, mContext, mFactory.ge tWebViewDelegate()); | 240 new WebViewContentsClientAdapter(mWebView, mContext, mFactory.ge tWebViewDelegate()); |
| 240 mWebSettings = new ContentSettingsAdapter(new AwSettings( | 241 mWebSettings = new ContentSettingsAdapter( |
| 241 mContext, isAccessFromFileURLsGrantedByDefault, areLegacyQuirksE nabled)); | 242 new AwSettings(mContext, isAccessFromFileURLsGrantedByDefault, |
| 243 areLegacyQuirksEnabled, allowEmptyDocumentPersistence)); | |
| 242 | 244 |
| 243 if (mAppTargetSdkVersion < Build.VERSION_CODES.LOLLIPOP) { | 245 if (mAppTargetSdkVersion < Build.VERSION_CODES.LOLLIPOP) { |
| 244 // Prior to Lollipop we always allowed third party cookies and mixed content. | 246 // Prior to Lollipop we always allowed third party cookies and mixed content. |
| 245 mWebSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_AL LOW); | 247 mWebSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_AL LOW); |
| 246 mWebSettings.setAcceptThirdPartyCookies(true); | 248 mWebSettings.setAcceptThirdPartyCookies(true); |
| 247 mWebSettings.getAwSettings().setZeroLayoutHeightDisablesViewportQuir k(true); | 249 mWebSettings.getAwSettings().setZeroLayoutHeightDisablesViewportQuir k(true); |
| 248 } | 250 } |
| 249 | 251 |
| 250 mRunQueue.addTask(new Runnable() { | 252 mRunQueue.addTask(new Runnable() { |
| 251 @Override | 253 @Override |
| (...skipping 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2354 mAwContents.extractSmartClipData(x, y, width, height); | 2356 mAwContents.extractSmartClipData(x, y, width, height); |
| 2355 } | 2357 } |
| 2356 | 2358 |
| 2357 // Implements SmartClipProvider | 2359 // Implements SmartClipProvider |
| 2358 @Override | 2360 @Override |
| 2359 public void setSmartClipResultHandler(final Handler resultHandler) { | 2361 public void setSmartClipResultHandler(final Handler resultHandler) { |
| 2360 checkThread(); | 2362 checkThread(); |
| 2361 mAwContents.setSmartClipResultHandler(resultHandler); | 2363 mAwContents.setSmartClipResultHandler(resultHandler); |
| 2362 } | 2364 } |
| 2363 } | 2365 } |
| OLD | NEW |