This source file includes following definitions.
- confirm
- confirm
- cancel
package org.chromium.android_webview;
import org.chromium.base.ThreadUtils;
class JsResultHandler implements JsResultReceiver, JsPromptResultReceiver {
private AwContentsClientBridge mBridge;
private final int mId;
JsResultHandler(AwContentsClientBridge bridge, int id) {
mBridge = bridge;
mId = id;
}
@Override
public void confirm() {
confirm(null);
}
@Override
public void confirm(final String promptResult) {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (mBridge != null)
mBridge.confirmJsResult(mId, promptResult);
mBridge = null;
}
});
}
@Override
public void cancel() {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (mBridge != null)
mBridge.cancelJsResult(mId);
mBridge = null;
}
});
}
}