| 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( | |
| 264 String url, boolean hasUserGesture, boolean isRedirect, boolean isMa
inFrame) { | |
| 265 return mClient.shouldIgnoreNavigation( | |
| 266 mContext, url, isMainFrame, hasUserGesture, isRedirect); | |
| 267 } | |
| 268 | |
| 269 void confirmJsResult(int id, String prompt) { | 262 void confirmJsResult(int id, String prompt) { |
| 270 if (mNativeContentsClientBridge == 0) return; | 263 if (mNativeContentsClientBridge == 0) return; |
| 271 nativeConfirmJsResult(mNativeContentsClientBridge, id, prompt); | 264 nativeConfirmJsResult(mNativeContentsClientBridge, id, prompt); |
| 272 } | 265 } |
| 273 | 266 |
| 274 void cancelJsResult(int id) { | 267 void cancelJsResult(int id) { |
| 275 if (mNativeContentsClientBridge == 0) return; | 268 if (mNativeContentsClientBridge == 0) return; |
| 276 nativeCancelJsResult(mNativeContentsClientBridge, id); | 269 nativeCancelJsResult(mNativeContentsClientBridge, id); |
| 277 } | 270 } |
| 278 | 271 |
| 279 //--------------------------------------------------------------------------
------------------ | 272 //--------------------------------------------------------------------------
------------------ |
| 280 // Native methods | 273 // Native methods |
| 281 //--------------------------------------------------------------------------
------------------ | 274 //--------------------------------------------------------------------------
------------------ |
| 282 private native void nativeProceedSslError(long nativeAwContentsClientBridge,
boolean proceed, | 275 private native void nativeProceedSslError(long nativeAwContentsClientBridge,
boolean proceed, |
| 283 int id); | 276 int id); |
| 284 private native void nativeProvideClientCertificateResponse(long nativeAwCont
entsClientBridge, | 277 private native void nativeProvideClientCertificateResponse(long nativeAwCont
entsClientBridge, |
| 285 int id, byte[][] certChain, AndroidPrivateKey androidKey); | 278 int id, byte[][] certChain, AndroidPrivateKey androidKey); |
| 286 | 279 |
| 287 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge,
int id, | 280 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge,
int id, |
| 288 String prompt); | 281 String prompt); |
| 289 private native void nativeCancelJsResult(long nativeAwContentsClientBridge,
int id); | 282 private native void nativeCancelJsResult(long nativeAwContentsClientBridge,
int id); |
| 290 } | 283 } |
| OLD | NEW |