Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java

Issue 133273033: call onPageFinished when you cancel the ssl error (Closed) Base URL: persistent-https://googleplex-android.git.corp.google.com/platform/external/chromium_org-history@master-chromium
Patch Set: address comments Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 org.chromium.android_webview; 5 package org.chromium.android_webview;
6 6
7 import android.net.http.SslCertificate; 7 import android.net.http.SslCertificate;
8 import android.net.http.SslError; 8 import android.net.http.SslError;
9 import android.webkit.ValueCallback; 9 import android.webkit.ValueCallback;
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 final SslCertificate cert = SslUtil.getCertificateFromDerBytes(derBytes) ; 48 final SslCertificate cert = SslUtil.getCertificateFromDerBytes(derBytes) ;
49 if (cert == null) { 49 if (cert == null) {
50 // if the certificate or the client is null, cancel the request 50 // if the certificate or the client is null, cancel the request
51 return false; 51 return false;
52 } 52 }
53 final SslError sslError = SslUtil.sslErrorFromNetErrorCode(certError, ce rt, url); 53 final SslError sslError = SslUtil.sslErrorFromNetErrorCode(certError, ce rt, url);
54 ValueCallback<Boolean> callback = new ValueCallback<Boolean>() { 54 ValueCallback<Boolean> callback = new ValueCallback<Boolean>() {
55 @Override 55 @Override
56 public void onReceiveValue(Boolean value) { 56 public void onReceiveValue(Boolean value) {
57 proceedSslError(value.booleanValue(), id); 57 proceedSslError(value.booleanValue(), id);
58 if (!value) {
59 // For backward compatibility with the classic
60 // webview, call onPageFinished after canceling ssl error.
61 AwContentsClientBridge.this.mClient.onPageFinished(url);
62 }
58 } 63 }
59 }; 64 };
60 mClient.onReceivedSslError(callback, sslError); 65 mClient.onReceivedSslError(callback, sslError);
61 return true; 66 return true;
62 } 67 }
63 68
64 private void proceedSslError(boolean proceed, int id) { 69 private void proceedSslError(boolean proceed, int id) {
65 if (mNativeContentsClientBridge == 0) return; 70 if (mNativeContentsClientBridge == 0) return;
66 nativeProceedSslError(mNativeContentsClientBridge, proceed, id); 71 nativeProceedSslError(mNativeContentsClientBridge, proceed, id);
67 } 72 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 //-------------------------------------------------------------------------- ------------------ 113 //-------------------------------------------------------------------------- ------------------
109 // Native methods 114 // Native methods
110 //-------------------------------------------------------------------------- ------------------ 115 //-------------------------------------------------------------------------- ------------------
111 private native void nativeProceedSslError(long nativeAwContentsClientBridge, boolean proceed, 116 private native void nativeProceedSslError(long nativeAwContentsClientBridge, boolean proceed,
112 int id); 117 int id);
113 118
114 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge, int id, 119 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge, int id,
115 String prompt); 120 String prompt);
116 private native void nativeCancelJsResult(long nativeAwContentsClientBridge, int id); 121 private native void nativeCancelJsResult(long nativeAwContentsClientBridge, int id);
117 } 122 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698