| OLD | NEW |
| 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.content.Context; | 7 import android.content.Context; |
| 8 import android.net.http.SslCertificate; | 8 import android.net.http.SslCertificate; |
| 9 import android.net.http.SslError; | 9 import android.net.http.SslError; |
| 10 import android.util.Log; | 10 import android.util.Log; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 JsResultHandler handler = new JsResultHandler(this, id); | 252 JsResultHandler handler = new JsResultHandler(this, id); |
| 253 mClient.handleJsPrompt(url, message, defaultValue, handler); | 253 mClient.handleJsPrompt(url, message, defaultValue, handler); |
| 254 } | 254 } |
| 255 | 255 |
| 256 @CalledByNative | 256 @CalledByNative |
| 257 private void handleJsBeforeUnload(String url, String message, int id) { | 257 private void handleJsBeforeUnload(String url, String message, int id) { |
| 258 JsResultHandler handler = new JsResultHandler(this, id); | 258 JsResultHandler handler = new JsResultHandler(this, id); |
| 259 mClient.handleJsBeforeUnload(url, message, handler); | 259 mClient.handleJsBeforeUnload(url, message, handler); |
| 260 } | 260 } |
| 261 | 261 |
| 262 @CalledByNative | |
| 263 private boolean shouldOverrideUrlLoading(String url, boolean hasUserGesture, | |
| 264 boolean isRedirect) { | |
| 265 if (mClient.hasWebViewClient()) { | |
| 266 return mClient.shouldOverrideUrlLoading(url); | |
| 267 } else { | |
| 268 return AwContentsClient.sendBrowsingIntent(mContext, url, hasUserGes
ture, isRedirect); | |
| 269 } | |
| 270 } | |
| 271 | |
| 272 void confirmJsResult(int id, String prompt) { | 262 void confirmJsResult(int id, String prompt) { |
| 273 if (mNativeContentsClientBridge == 0) return; | 263 if (mNativeContentsClientBridge == 0) return; |
| 274 nativeConfirmJsResult(mNativeContentsClientBridge, id, prompt); | 264 nativeConfirmJsResult(mNativeContentsClientBridge, id, prompt); |
| 275 } | 265 } |
| 276 | 266 |
| 277 void cancelJsResult(int id) { | 267 void cancelJsResult(int id) { |
| 278 if (mNativeContentsClientBridge == 0) return; | 268 if (mNativeContentsClientBridge == 0) return; |
| 279 nativeCancelJsResult(mNativeContentsClientBridge, id); | 269 nativeCancelJsResult(mNativeContentsClientBridge, id); |
| 280 } | 270 } |
| 281 | 271 |
| 282 //--------------------------------------------------------------------------
------------------ | 272 //--------------------------------------------------------------------------
------------------ |
| 283 // Native methods | 273 // Native methods |
| 284 //--------------------------------------------------------------------------
------------------ | 274 //--------------------------------------------------------------------------
------------------ |
| 285 private native void nativeProceedSslError(long nativeAwContentsClientBridge,
boolean proceed, | 275 private native void nativeProceedSslError(long nativeAwContentsClientBridge,
boolean proceed, |
| 286 int id); | 276 int id); |
| 287 private native void nativeProvideClientCertificateResponse(long nativeAwCont
entsClientBridge, | 277 private native void nativeProvideClientCertificateResponse(long nativeAwCont
entsClientBridge, |
| 288 int id, byte[][] certChain, AndroidPrivateKey androidKey); | 278 int id, byte[][] certChain, AndroidPrivateKey androidKey); |
| 289 | 279 |
| 290 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge,
int id, | 280 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge,
int id, |
| 291 String prompt); | 281 String prompt); |
| 292 private native void nativeCancelJsResult(long nativeAwContentsClientBridge,
int id); | 282 private native void nativeCancelJsResult(long nativeAwContentsClientBridge,
int id); |
| 293 } | 283 } |
| OLD | NEW |