@Override
 public void onJsResultComplete(JsResult result) {
   if (mChromePromptResultReceiver != null) {
     if (mPromptResult.getResult()) {
       mChromePromptResultReceiver.confirm(mPromptResult.getStringResult());
     } else {
       mChromePromptResultReceiver.cancel();
     }
   } else {
     if (mPromptResult.getResult()) {
       mChromeResultReceiver.confirm();
     } else {
       mChromeResultReceiver.cancel();
     }
   }
 }
 @Override
 public void handleJsPrompt(
     String url, String message, String defaultValue, JsPromptResultReceiver receiver) {
   TraceEvent.begin();
   if (mWebChromeClient != null) {
     final JsPromptResult res = new JsPromptResultReceiverAdapter(receiver).getPromptResult();
     if (TRACE) Log.d(TAG, "onJsPrompt");
     if (!mWebChromeClient.onJsPrompt(mWebView, url, message, defaultValue, res)) {
       new JsDialogHelper(res, JsDialogHelper.PROMPT, defaultValue, message, url)
           .showDialog(mWebView.getContext());
     }
   } else {
     receiver.cancel();
   }
   TraceEvent.end();
 }