1 // Copyright (c) 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.xwalk.core;
7 import org.chromium.base.ThreadUtils;
9 class JsResultHandler implements JsResult, JsPromptResult {
10 private XWalkContentsClientBridge mBridge;
11 private final int mId;
13 JsResultHandler(XWalkContentsClientBridge 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);