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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 | 107 |
108 private static boolean sRecordWholeDocumentEnabledByApi = false; | 108 private static boolean sRecordWholeDocumentEnabledByApi = false; |
109 static void enableSlowWholeDocumentDraw() { | 109 static void enableSlowWholeDocumentDraw() { |
110 sRecordWholeDocumentEnabledByApi = true; | 110 sRecordWholeDocumentEnabledByApi = true; |
111 } | 111 } |
112 | 112 |
113 // This does not touch any global / non-threadsafe state, but note that | 113 // This does not touch any global / non-threadsafe state, but note that |
114 // init is ofter called right after and is NOT threadsafe. | 114 // init is ofter called right after and is NOT threadsafe. |
115 public WebViewChromium(WebViewChromiumFactoryProvider factory, WebView webVi ew, | 115 public WebViewChromium(WebViewChromiumFactoryProvider factory, WebView webVi ew, |
116 WebView.PrivateAccess webViewPrivate, boolean shouldDisableThreadChe cking) { | 116 WebView.PrivateAccess webViewPrivate, boolean shouldDisableThreadChe cking) { |
117 WebViewChromiumFactoryProvider.checkStorageIsNotDeviceProtected(webView. getContext()); | 117 Context ctx = WebViewChromiumFactoryProvider.switchToCredentialProtected Storage( |
Torne
2016/09/21 12:04:18
You're still allowing a WebView to be constructed
Nate Fischer
2016/09/22 04:21:12
I'm a bit confused about what you mean here.
Digg
Torne
2016/09/22 09:59:54
These are two totally unrelated things that use di
| |
118 webView.getContext()); | |
118 mWebView = webView; | 119 mWebView = webView; |
119 mWebViewPrivate = webViewPrivate; | 120 mWebViewPrivate = webViewPrivate; |
120 mHitTestResult = new WebView.HitTestResult(); | 121 mHitTestResult = new WebView.HitTestResult(); |
121 mContext = ResourcesContextWrapperFactory.get(mWebView.getContext()); | 122 mContext = ResourcesContextWrapperFactory.get(ctx); |
122 mAppTargetSdkVersion = mContext.getApplicationInfo().targetSdkVersion; | 123 mAppTargetSdkVersion = mContext.getApplicationInfo().targetSdkVersion; |
123 mFactory = factory; | 124 mFactory = factory; |
124 mShouldDisableThreadChecking = shouldDisableThreadChecking; | 125 mShouldDisableThreadChecking = shouldDisableThreadChecking; |
125 factory.getWebViewDelegate().addWebViewAssetPath(mWebView.getContext()); | 126 factory.getWebViewDelegate().addWebViewAssetPath(ctx); |
126 } | 127 } |
127 | 128 |
128 static void completeWindowCreation(WebView parent, WebView child) { | 129 static void completeWindowCreation(WebView parent, WebView child) { |
129 AwContents parentContents = ((WebViewChromium) parent.getWebViewProvider ()).mAwContents; | 130 AwContents parentContents = ((WebViewChromium) parent.getWebViewProvider ()).mAwContents; |
130 AwContents childContents = | 131 AwContents childContents = |
131 child == null ? null : ((WebViewChromium) child.getWebViewProvid er()).mAwContents; | 132 child == null ? null : ((WebViewChromium) child.getWebViewProvid er()).mAwContents; |
132 parentContents.supplyContentsForPopup(childContents); | 133 parentContents.supplyContentsForPopup(childContents); |
133 } | 134 } |
134 | 135 |
135 // WebViewProvider methods ------------------------------------------------- ------------------- | 136 // WebViewProvider methods ------------------------------------------------- ------------------- |
(...skipping 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2262 mAwContents.extractSmartClipData(x, y, width, height); | 2263 mAwContents.extractSmartClipData(x, y, width, height); |
2263 } | 2264 } |
2264 | 2265 |
2265 // Implements SmartClipProvider | 2266 // Implements SmartClipProvider |
2266 @Override | 2267 @Override |
2267 public void setSmartClipResultHandler(final Handler resultHandler) { | 2268 public void setSmartClipResultHandler(final Handler resultHandler) { |
2268 checkThread(); | 2269 checkThread(); |
2269 mAwContents.setSmartClipResultHandler(resultHandler); | 2270 mAwContents.setSmartClipResultHandler(resultHandler); |
2270 } | 2271 } |
2271 } | 2272 } |
OLD | NEW |