| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 JsResultHandler handler = new JsResultHandler(this, id); | 84 JsResultHandler handler = new JsResultHandler(this, id); |
| 85 mClient.handleJsPrompt(url, message, defaultValue, handler); | 85 mClient.handleJsPrompt(url, message, defaultValue, handler); |
| 86 } | 86 } |
| 87 | 87 |
| 88 @CalledByNative | 88 @CalledByNative |
| 89 private void handleJsBeforeUnload(String url, String message, int id) { | 89 private void handleJsBeforeUnload(String url, String message, int id) { |
| 90 JsResultHandler handler = new JsResultHandler(this, id); | 90 JsResultHandler handler = new JsResultHandler(this, id); |
| 91 mClient.handleJsBeforeUnload(url, message, handler); | 91 mClient.handleJsBeforeUnload(url, message, handler); |
| 92 } | 92 } |
| 93 | 93 |
| 94 @CalledByNative |
| 95 private boolean shouldOverrideUrlLoading(String url) { |
| 96 return mClient.shouldOverrideUrlLoading(url); |
| 97 } |
| 98 |
| 94 void confirmJsResult(int id, String prompt) { | 99 void confirmJsResult(int id, String prompt) { |
| 95 if (mNativeContentsClientBridge == 0) return; | 100 if (mNativeContentsClientBridge == 0) return; |
| 96 nativeConfirmJsResult(mNativeContentsClientBridge, id, prompt); | 101 nativeConfirmJsResult(mNativeContentsClientBridge, id, prompt); |
| 97 } | 102 } |
| 98 | 103 |
| 99 void cancelJsResult(int id) { | 104 void cancelJsResult(int id) { |
| 100 if (mNativeContentsClientBridge == 0) return; | 105 if (mNativeContentsClientBridge == 0) return; |
| 101 nativeCancelJsResult(mNativeContentsClientBridge, id); | 106 nativeCancelJsResult(mNativeContentsClientBridge, id); |
| 102 } | 107 } |
| 103 | 108 |
| 104 //--------------------------------------------------------------------------
------------------ | 109 //--------------------------------------------------------------------------
------------------ |
| 105 // Native methods | 110 // Native methods |
| 106 //--------------------------------------------------------------------------
------------------ | 111 //--------------------------------------------------------------------------
------------------ |
| 107 private native void nativeProceedSslError(long nativeAwContentsClientBridge,
boolean proceed, | 112 private native void nativeProceedSslError(long nativeAwContentsClientBridge,
boolean proceed, |
| 108 int id); | 113 int id); |
| 109 | 114 |
| 110 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge,
int id, | 115 private native void nativeConfirmJsResult(long nativeAwContentsClientBridge,
int id, |
| 111 String prompt); | 116 String prompt); |
| 112 private native void nativeCancelJsResult(long nativeAwContentsClientBridge,
int id); | 117 private native void nativeCancelJsResult(long nativeAwContentsClientBridge,
int id); |
| 113 } | 118 } |
| OLD | NEW |