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

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: 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 // Need to call onPageFinished when you cancel on the ssl er ror
sgurun-gerrit only 2014/01/18 00:35:42 I think a less verbose comment is better. Maybe sa
benm (inactive) 2014/01/20 20:04:59 Maybe worth noting that this is done for backwards
hush (inactive) 2014/01/24 21:52:26 Done.
hush (inactive) 2014/01/24 21:52:26 Done.
60 AwContentsClientBridge.this.mClient.onPageFinished(url);
61 }
58 } 62 }
59 }; 63 };
60 mClient.onReceivedSslError(callback, sslError); 64 mClient.onReceivedSslError(callback, sslError);
61 return true; 65 return true;
62 } 66 }
63 67
64 private void proceedSslError(boolean proceed, int id) { 68 private void proceedSslError(boolean proceed, int id) {
65 if (mNativeContentsClientBridge == 0) return; 69 if (mNativeContentsClientBridge == 0) return;
66 nativeProceedSslError(mNativeContentsClientBridge, proceed, id); 70 nativeProceedSslError(mNativeContentsClientBridge, proceed, id);
67 } 71 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 //-------------------------------------------------------------------------- ------------------ 112 //-------------------------------------------------------------------------- ------------------
109 // Native methods 113 // Native methods
110 //-------------------------------------------------------------------------- ------------------ 114 //-------------------------------------------------------------------------- ------------------
111 private native void nativeProceedSslError(long nativeAwContentsClientBridge, boolean proceed, 115 private native void nativeProceedSslError(long nativeAwContentsClientBridge, boolean proceed,
112 int id); 116 int id);
113 117
114 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge, int id, 118 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge, int id,
115 String prompt); 119 String prompt);
116 private native void nativeCancelJsResult(long nativeAwContentsClientBridge, int id); 120 private native void nativeCancelJsResult(long nativeAwContentsClientBridge, int id);
117 } 121 }
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