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.internal;
7 import org.chromium.base.ThreadUtils;
9 public class XWalkJavascriptResultHandlerInternal implements XWalkJavascriptResultInternal {
10 private XWalkContentsClientBridge mBridge;
11 private final int mId;
13 XWalkJavascriptResultHandlerInternal(XWalkContentsClientBridge bridge, int id) {
19 public void confirm() {
20 confirmWithResult(null);
24 public void confirmWithResult(final String promptResult) {
25 ThreadUtils.runOnUiThread(new Runnable() {
28 if (mBridge != null) {
29 mBridge.confirmJsResult(mId, promptResult);
37 public void cancel() {
38 ThreadUtils.runOnUiThread(new Runnable() {
41 if (mBridge != null) {
42 mBridge.cancelJsResult(mId);