| 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.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 /** | 342 /** |
| 343 * @see AwContentsClient#shouldOverrideUrlLoading(AwContentsClient.AwWebReso
urceRequest) | 343 * @see AwContentsClient#shouldOverrideUrlLoading(AwContentsClient.AwWebReso
urceRequest) |
| 344 */ | 344 */ |
| 345 @TargetApi(Build.VERSION_CODES.N) | 345 @TargetApi(Build.VERSION_CODES.N) |
| 346 @Override | 346 @Override |
| 347 public boolean shouldOverrideUrlLoading(AwContentsClient.AwWebResourceReques
t request) { | 347 public boolean shouldOverrideUrlLoading(AwContentsClient.AwWebResourceReques
t request) { |
| 348 try { | 348 try { |
| 349 TraceEvent.begin("WebViewContentsClientAdapter.shouldOverrideUrlLoad
ing"); | 349 TraceEvent.begin("WebViewContentsClientAdapter.shouldOverrideUrlLoad
ing"); |
| 350 if (TRACE) Log.d(TAG, "shouldOverrideUrlLoading=" + request.url); | 350 if (TRACE) Log.d(TAG, "shouldOverrideUrlLoading=" + request.url); |
| 351 boolean result; | 351 boolean result; |
| 352 if (Build.VERSION.CODENAME.equals("N") | 352 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| 353 || Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { | |
| 354 result = mWebViewClient.shouldOverrideUrlLoading( | 353 result = mWebViewClient.shouldOverrideUrlLoading( |
| 355 mWebView, new WebResourceRequestImpl(request)); | 354 mWebView, new WebResourceRequestImpl(request)); |
| 356 } else { | 355 } else { |
| 357 result = mWebViewClient.shouldOverrideUrlLoading(mWebView, reque
st.url); | 356 result = mWebViewClient.shouldOverrideUrlLoading(mWebView, reque
st.url); |
| 358 } | 357 } |
| 359 return result; | 358 return result; |
| 360 } finally { | 359 } finally { |
| 361 TraceEvent.end("WebViewContentsClientAdapter.shouldOverrideUrlLoadin
g"); | 360 TraceEvent.end("WebViewContentsClientAdapter.shouldOverrideUrlLoadin
g"); |
| 362 } | 361 } |
| 363 } | 362 } |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 mAwPermissionRequest.deny(); | 1309 mAwPermissionRequest.deny(); |
| 1311 } | 1310 } |
| 1312 } | 1311 } |
| 1313 | 1312 |
| 1314 @Override | 1313 @Override |
| 1315 public void deny() { | 1314 public void deny() { |
| 1316 mAwPermissionRequest.deny(); | 1315 mAwPermissionRequest.deny(); |
| 1317 } | 1316 } |
| 1318 } | 1317 } |
| 1319 } | 1318 } |
| OLD | NEW |