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.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 156 matching lines...) Loading... | |
167 } | 167 } |
168 } | 168 } |
169 | 169 |
170 final boolean isAccessFromFileURLsGrantedByDefault = | 170 final boolean isAccessFromFileURLsGrantedByDefault = |
171 mAppTargetSdkVersion < Build.VERSION_CODES.JELLY_BEAN; | 171 mAppTargetSdkVersion < Build.VERSION_CODES.JELLY_BEAN; |
172 final boolean areLegacyQuirksEnabled = mAppTargetSdkVersion < Build.VERS ION_CODES.KITKAT; | 172 final boolean areLegacyQuirksEnabled = mAppTargetSdkVersion < Build.VERS ION_CODES.KITKAT; |
173 final boolean allowEmptyDocumentPersistence = mAppTargetSdkVersion <= Bu ild.VERSION_CODES.M; | 173 final boolean allowEmptyDocumentPersistence = mAppTargetSdkVersion <= Bu ild.VERSION_CODES.M; |
174 final boolean allowGeolocationOnInsecureOrigins = | 174 final boolean allowGeolocationOnInsecureOrigins = |
175 mAppTargetSdkVersion <= Build.VERSION_CODES.M; | 175 mAppTargetSdkVersion <= Build.VERSION_CODES.M; |
176 | 176 |
177 final String samsungEmailPackageId = "com.samsung.android.email.provider "; | |
aelias_OOO_until_Jul13
2017/03/31 23:40:21
I don't think an APK name check is called for here
Changwan Ryu
2017/04/01 00:07:56
Done. Also checking with Samsung about the package
| |
178 final boolean doNotUpdateSelectionOnMutatingSelectionRange = | |
179 samsungEmailPackageId.equals(mContext.getPackageName()) | |
180 && mAppTargetSdkVersion <= Build.VERSION_CODES.M; | |
aelias_OOO_until_Jul13
2017/03/31 23:25:41
Why M and below? I would've expected N and below.
Changwan Ryu
2017/03/31 23:28:10
Sorry I wasn't super clear about this. Samsung's i
aelias_OOO_until_Jul13
2017/03/31 23:40:21
OK sounds good. Targeting M is somewhat better if
| |
181 | |
177 mContentsClientAdapter = mFactory.createWebViewContentsClientAdapter(mWe bView, mContext); | 182 mContentsClientAdapter = mFactory.createWebViewContentsClientAdapter(mWe bView, mContext); |
178 mWebSettings = new ContentSettingsAdapter( | 183 mWebSettings = new ContentSettingsAdapter(new AwSettings(mContext, |
179 new AwSettings(mContext, isAccessFromFileURLsGrantedByDefault, | 184 isAccessFromFileURLsGrantedByDefault, areLegacyQuirksEnabled, |
180 areLegacyQuirksEnabled, allowEmptyDocumentPersistence, | 185 allowEmptyDocumentPersistence, allowGeolocationOnInsecureOrigins , |
181 allowGeolocationOnInsecureOrigins)); | 186 doNotUpdateSelectionOnMutatingSelectionRange)); |
182 | 187 |
183 if (mAppTargetSdkVersion < Build.VERSION_CODES.LOLLIPOP) { | 188 if (mAppTargetSdkVersion < Build.VERSION_CODES.LOLLIPOP) { |
184 // Prior to Lollipop we always allowed third party cookies and mixed content. | 189 // Prior to Lollipop we always allowed third party cookies and mixed content. |
185 mWebSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_AL LOW); | 190 mWebSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_AL LOW); |
186 mWebSettings.setAcceptThirdPartyCookies(true); | 191 mWebSettings.setAcceptThirdPartyCookies(true); |
187 mWebSettings.getAwSettings().setZeroLayoutHeightDisablesViewportQuir k(true); | 192 mWebSettings.getAwSettings().setZeroLayoutHeightDisablesViewportQuir k(true); |
188 } | 193 } |
189 | 194 |
190 if (mShouldDisableThreadChecking) disableThreadChecking(); | 195 if (mShouldDisableThreadChecking) disableThreadChecking(); |
191 | 196 |
(...skipping 2081 matching lines...) Loading... | |
2273 mAwContents.extractSmartClipData(x, y, width, height); | 2278 mAwContents.extractSmartClipData(x, y, width, height); |
2274 } | 2279 } |
2275 | 2280 |
2276 // Implements SmartClipProvider | 2281 // Implements SmartClipProvider |
2277 @Override | 2282 @Override |
2278 public void setSmartClipResultHandler(final Handler resultHandler) { | 2283 public void setSmartClipResultHandler(final Handler resultHandler) { |
2279 checkThread(); | 2284 checkThread(); |
2280 mAwContents.setSmartClipResultHandler(resultHandler); | 2285 mAwContents.setSmartClipResultHandler(resultHandler); |
2281 } | 2286 } |
2282 } | 2287 } |
OLD | NEW |