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.content.Context; | 8 import android.content.Context; |
| 8 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
| 9 import android.graphics.BitmapFactory; | 10 import android.graphics.BitmapFactory; |
| 10 import android.graphics.Canvas; | 11 import android.graphics.Canvas; |
| 11 import android.graphics.Color; | 12 import android.graphics.Color; |
| 12 import android.graphics.Picture; | 13 import android.graphics.Picture; |
| 13 import android.net.Uri; | 14 import android.net.Uri; |
| 14 import android.net.http.SslError; | 15 import android.net.http.SslError; |
| 15 import android.os.Build; | 16 import android.os.Build; |
| 16 import android.os.Handler; | 17 import android.os.Handler; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 * | 73 * |
| 73 * A {@link ContentViewClient} may be shared between multiple {@link ContentView }s, | 74 * A {@link ContentViewClient} may be shared between multiple {@link ContentView }s, |
| 74 * and hence multiple WebViews. Many WebViewClient methods pass the source | 75 * and hence multiple WebViews. Many WebViewClient methods pass the source |
| 75 * WebView as an argument. This means that we either need to pass the | 76 * WebView as an argument. This means that we either need to pass the |
| 76 * corresponding ContentView to the corresponding ContentViewClient methods, | 77 * corresponding ContentView to the corresponding ContentViewClient methods, |
| 77 * or use an instance of ContentViewClientAdapter per WebViewChromium, to | 78 * or use an instance of ContentViewClientAdapter per WebViewChromium, to |
| 78 * allow the source WebView to be injected by ContentViewClientAdapter. We | 79 * allow the source WebView to be injected by ContentViewClientAdapter. We |
| 79 * choose the latter, because it makes for a cleaner design. | 80 * choose the latter, because it makes for a cleaner design. |
| 80 */ | 81 */ |
| 81 @SuppressWarnings("deprecation") | 82 @SuppressWarnings("deprecation") |
| 83 @SuppressLint("NewApi") | |
|
newt (away)
2015/10/13 20:41:38
same deal here
michaelbai
2015/10/13 21:40:15
Changed to use TargetApi, but it is a little bit o
| |
| 82 public class WebViewContentsClientAdapter extends AwContentsClient { | 84 public class WebViewContentsClientAdapter extends AwContentsClient { |
| 83 // TAG is chosen for consistency with classic webview tracing. | 85 // TAG is chosen for consistency with classic webview tracing. |
| 84 private static final String TAG = "WebViewCallback"; | 86 private static final String TAG = "WebViewCallback"; |
| 85 // Enables API callback tracing | 87 // Enables API callback tracing |
| 86 private static final boolean TRACE = false; | 88 private static final boolean TRACE = false; |
| 87 // Default WebViewClient used to avoid null checks. | 89 // Default WebViewClient used to avoid null checks. |
| 88 private static WebViewClient sNullWebViewClient = new WebViewClient(); | 90 private static WebViewClient sNullWebViewClient = new WebViewClient(); |
| 89 // The WebView instance that this adapter is serving. | 91 // The WebView instance that this adapter is serving. |
| 90 private final WebView mWebView; | 92 private final WebView mWebView; |
| 91 // The Context to use. This is different from mWebView.getContext(), which s hould not be used. | 93 // The Context to use. This is different from mWebView.getContext(), which s hould not be used. |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1273 mAwPermissionRequest.deny(); | 1275 mAwPermissionRequest.deny(); |
| 1274 } | 1276 } |
| 1275 } | 1277 } |
| 1276 | 1278 |
| 1277 @Override | 1279 @Override |
| 1278 public void deny() { | 1280 public void deny() { |
| 1279 mAwPermissionRequest.deny(); | 1281 mAwPermissionRequest.deny(); |
| 1280 } | 1282 } |
| 1281 } | 1283 } |
| 1282 } | 1284 } |
| OLD | NEW |