| Index: android_webview/java/src/org/chromium/android_webview/JsResultHandler.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/JsResultHandler.java b/android_webview/java/src/org/chromium/android_webview/JsResultHandler.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..372032401ad0ec6a00582f776c29b84976ce3ce2
|
| --- /dev/null
|
| +++ b/android_webview/java/src/org/chromium/android_webview/JsResultHandler.java
|
| @@ -0,0 +1,39 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.android_webview;
|
| +import org.chromium.base.CalledByNative;
|
| +import org.chromium.base.JNINamespace;
|
| +
|
| +@JNINamespace("android_webview")
|
| +public class JsResultHandler implements JsResultReceiver, JsPromptResultReceiver {
|
| + private int mNativeDialogPointer;
|
| +
|
| + @CalledByNative
|
| + public static JsResultHandler create(int nativeDialogPointer) {
|
| + return new JsResultHandler(nativeDialogPointer);
|
| + }
|
| +
|
| + private JsResultHandler(int nativeDialogPointer) {
|
| + mNativeDialogPointer = nativeDialogPointer;
|
| + }
|
| +
|
| + @Override
|
| + public void confirm() {
|
| + confirm(null);
|
| + }
|
| +
|
| + @Override
|
| + public void confirm(String promptResult) {
|
| + nativeConfirmJsResult(mNativeDialogPointer, promptResult);
|
| + }
|
| +
|
| + @Override
|
| + public void cancel() {
|
| + nativeCancelJsResult(mNativeDialogPointer);
|
| + }
|
| +
|
| + private native void nativeConfirmJsResult(int dialogPointer, String promptResult);
|
| + private native void nativeCancelJsResult(int dialogPointer);
|
| +}
|
|
|