Exemplo n.º 1
0
  private void handleReady(final JSONObject message) {
    connectToGecko();

    if (mChromeDelegate != null) {
      mChromeDelegate.onReady(this);
    }
  }
Exemplo n.º 2
0
 private void handlePrompt(final JSONObject message) throws JSONException {
   if (mChromeDelegate != null) {
     String hint = message.optString("hint");
     if ("alert".equals(hint)) {
       String text = message.optString("text");
       mChromeDelegate.onAlert(
           GeckoView.this, null, text, new PromptResult(message.optString("guid")));
     } else if ("confirm".equals(hint)) {
       String text = message.optString("text");
       mChromeDelegate.onConfirm(
           GeckoView.this, null, text, new PromptResult(message.optString("guid")));
     } else if ("prompt".equals(hint)) {
       String text = message.optString("text");
       String defaultValue = message.optString("textbox0");
       mChromeDelegate.onPrompt(
           GeckoView.this, null, text, defaultValue, new PromptResult(message.optString("guid")));
     } else if ("remotedebug".equals(hint)) {
       mChromeDelegate.onDebugRequest(GeckoView.this, new PromptResult(message.optString("guid")));
     }
   }
 }