1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.chromium.android_webview;
7 import org.chromium.base.ThreadUtils;
9 class JsResultHandler implements JsResultReceiver, JsPromptResultReceiver {
10 private AwContentsClientBridge mBridge;
11 private final int mId;
13 JsResultHandler(AwContentsClientBridge bridge, int id) {
19 public void confirm() {
24 public void confirm(final String promptResult) {
25 ThreadUtils.runOnUiThread(new Runnable() {
29 mBridge.confirmJsResult(mId, promptResult);
36 public void cancel() {
37 ThreadUtils.runOnUiThread(new Runnable() {
41 mBridge.cancelJsResult(mId);