| 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.TargetApi; | 8 import android.annotation.TargetApi; |
| 8 import android.content.Context; | 9 import android.content.Context; |
| 9 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
| 10 import android.graphics.BitmapFactory; | 11 import android.graphics.BitmapFactory; |
| 11 import android.graphics.Canvas; | 12 import android.graphics.Canvas; |
| 12 import android.graphics.Color; | 13 import android.graphics.Color; |
| 13 import android.graphics.Picture; | 14 import android.graphics.Picture; |
| 14 import android.net.Uri; | 15 import android.net.Uri; |
| 15 import android.net.http.SslError; | 16 import android.net.http.SslError; |
| 16 import android.os.Build; | 17 import android.os.Build; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 private WebViewDelegate mWebViewDelegate; | 104 private WebViewDelegate mWebViewDelegate; |
| 104 | 105 |
| 105 private DownloadListener mDownloadListener; | 106 private DownloadListener mDownloadListener; |
| 106 | 107 |
| 107 private Handler mUiThreadHandler; | 108 private Handler mUiThreadHandler; |
| 108 | 109 |
| 109 private static final int NEW_WEBVIEW_CREATED = 100; | 110 private static final int NEW_WEBVIEW_CREATED = 100; |
| 110 | 111 |
| 111 private WeakHashMap<AwPermissionRequest, WeakReference<PermissionRequestAdap
ter>> | 112 private WeakHashMap<AwPermissionRequest, WeakReference<PermissionRequestAdap
ter>> |
| 112 mOngoingPermissionRequests; | 113 mOngoingPermissionRequests; |
| 114 |
| 113 /** | 115 /** |
| 114 * Adapter constructor. | 116 * Adapter constructor. |
| 115 * | 117 * |
| 116 * @param webView the {@link WebView} instance that this adapter is serving. | 118 * @param webView the {@link WebView} instance that this adapter is serving. |
| 117 */ | 119 */ |
| 120 @SuppressLint("HandlerLeak") |
| 118 WebViewContentsClientAdapter(WebView webView, Context context, | 121 WebViewContentsClientAdapter(WebView webView, Context context, |
| 119 WebViewDelegate webViewDelegate) { | 122 WebViewDelegate webViewDelegate) { |
| 120 if (webView == null || webViewDelegate == null) { | 123 if (webView == null || webViewDelegate == null) { |
| 121 throw new IllegalArgumentException("webView or delegate can't be nul
l."); | 124 throw new IllegalArgumentException("webView or delegate can't be nul
l."); |
| 122 } | 125 } |
| 123 | 126 |
| 124 if (context == null) { | 127 if (context == null) { |
| 125 throw new IllegalArgumentException("context can't be null."); | 128 throw new IllegalArgumentException("context can't be null."); |
| 126 } | 129 } |
| 127 | 130 |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 mAwPermissionRequest.deny(); | 1285 mAwPermissionRequest.deny(); |
| 1283 } | 1286 } |
| 1284 } | 1287 } |
| 1285 | 1288 |
| 1286 @Override | 1289 @Override |
| 1287 public void deny() { | 1290 public void deny() { |
| 1288 mAwPermissionRequest.deny(); | 1291 mAwPermissionRequest.deny(); |
| 1289 } | 1292 } |
| 1290 } | 1293 } |
| 1291 } | 1294 } |
| OLD | NEW |