Updated Branches:
  refs/heads/master ba3142460 -> 5ff900f7e

Fixup for CB-2654.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/5ff900f7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/5ff900f7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/5ff900f7

Branch: refs/heads/master
Commit: 5ff900f7ecfb0d2ee270697c66f64979f0008700
Parents: ba31424
Author: Andrew Grieve <[email protected]>
Authored: Thu Apr 4 16:45:39 2013 -0400
Committer: Andrew Grieve <[email protected]>
Committed: Thu Apr 4 16:45:39 2013 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/InAppBrowser.java |   18 ++++----------
 1 files changed, 5 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/5ff900f7/framework/src/org/apache/cordova/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/InAppBrowser.java 
b/framework/src/org/apache/cordova/InAppBrowser.java
index 47f987c..8e78baa 100644
--- a/framework/src/org/apache/cordova/InAppBrowser.java
+++ b/framework/src/org/apache/cordova/InAppBrowser.java
@@ -93,9 +93,6 @@ public class InAppBrowser extends CordovaPlugin {
      * @return              A PluginResult object with a status and message.
      */
     public boolean execute(String action, JSONArray args, CallbackContext 
callbackContext) throws JSONException {
-        PluginResult.Status status = PluginResult.Status.OK;
-        String result = "";
-        
         try {
             if (action.equals("open")) {
                 this.callbackContext = callbackContext;
@@ -109,6 +106,7 @@ public class InAppBrowser extends CordovaPlugin {
                 Log.d(LOG_TAG, "target = " + target);
 
                 url = updateUrl(url);
+                String result = "";
 
                 // SELF
                 if (SELF.equals(target)) {
@@ -144,17 +142,14 @@ public class InAppBrowser extends CordovaPlugin {
                     Log.d(LOG_TAG, "in blank");
                     result = this.showWebPage(url, features);
                 }
-                PluginResult pluginResult = new PluginResult(status, result);
+
+                PluginResult pluginResult = new 
PluginResult(PluginResult.Status.OK, result);
                 pluginResult.setKeepCallback(true);
                 this.callbackContext.sendPluginResult(pluginResult);
             }
             else if (action.equals("close")) {
-                this.callbackContext = callbackContext;
                 closeDialog();
-
-                PluginResult pluginResult = new 
PluginResult(PluginResult.Status.OK);
-                pluginResult.setKeepCallback(false);
-                this.callbackContext.sendPluginResult(pluginResult);
+                this.callbackContext.sendPluginResult(new 
PluginResult(PluginResult.Status.OK));
             }
             else if (action.equals("injectScriptCode")) {
                 String jsWrapper = null;
@@ -191,10 +186,7 @@ public class InAppBrowser extends CordovaPlugin {
                 injectDeferredObject(args.getString(0), jsWrapper);
             }
             else {
-                status = PluginResult.Status.INVALID_ACTION;
-                PluginResult pluginResult = new PluginResult(status, result);
-                pluginResult.setKeepCallback(true);
-                this.callbackContext.sendPluginResult(pluginResult);
+                return false;
             }
         } catch (JSONException e) {
             this.callbackContext.sendPluginResult(new 
PluginResult(PluginResult.Status.JSON_EXCEPTION));

Reply via email to