incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject android commit: Working. Pushing the callback server change again.
Date Wed, 11 Apr 2012 20:24:00 GMT
Updated Branches:
  refs/heads/CordovaWebView e77f9bb8f -> b99e9abb5


Working. Pushing the callback server change again.


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

Branch: refs/heads/CordovaWebView
Commit: b99e9abb5f33b626e4441e7829fae5ab5a8c3e39
Parents: e77f9bb
Author: Joe Bowser <bowserj@apache.org>
Authored: Wed Apr 11 13:23:45 2012 -0700
Committer: Joe Bowser <bowserj@apache.org>
Committed: Wed Apr 11 13:23:45 2012 -0700

----------------------------------------------------------------------
 .../org/apache/cordova/CordovaChromeClient.java    |   10 +++++-----
 .../src/org/apache/cordova/CordovaWebView.java     |    2 ++
 .../org/apache/cordova/CordovaWebViewClient.java   |    4 ++--
 framework/src/org/apache/cordova/DroidGap.java     |   13 ++++++-------
 4 files changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/b99e9abb/framework/src/org/apache/cordova/CordovaChromeClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaChromeClient.java b/framework/src/org/apache/cordova/CordovaChromeClient.java
index 49ec1b5..c3c7e21 100755
--- a/framework/src/org/apache/cordova/CordovaChromeClient.java
+++ b/framework/src/org/apache/cordova/CordovaChromeClient.java
@@ -199,7 +199,7 @@ public class CordovaChromeClient extends WebChromeClient {
         
         // Polling for JavaScript messages 
         else if (reqOk && defaultValue != null && defaultValue.equals("gap_poll:"))
{
-            String r = ctx.callbackServer.getJavascript();
+            String r = appView.callbackServer.getJavascript();
             result.confirm(r);
         }
         
@@ -207,16 +207,16 @@ public class CordovaChromeClient extends WebChromeClient {
         else if (reqOk && defaultValue != null && defaultValue.equals("gap_callbackServer:"))
{
             String r = "";
             if (message.equals("usePolling")) {
-                r = ""+ ctx.callbackServer.usePolling();
+                r = ""+ appView.callbackServer.usePolling();
             }
             else if (message.equals("restartServer")) {
-                ctx.callbackServer.restartServer();
+                appView.callbackServer.restartServer();
             }
             else if (message.equals("getPort")) {
-                r = Integer.toString(ctx.callbackServer.getPort());
+                r = Integer.toString(appView.callbackServer.getPort());
             }
             else if (message.equals("getToken")) {
-                r = ctx.callbackServer.getToken();
+                r = appView.callbackServer.getToken();
             }
             result.confirm(r);
         }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/b99e9abb/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index aaa11ed..ffb0cfd 100644
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -30,6 +30,8 @@ public class CordovaWebView extends WebView {
   private ArrayList<Pattern> whiteList = new ArrayList<Pattern>();
   private HashMap<String, Boolean> whiteListCache = new HashMap<String,Boolean>();
   protected PluginManager pluginManager;
+  public CallbackServer callbackServer;
+
   
   /** Actvities and other important classes **/
   private Context mCtx;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/b99e9abb/framework/src/org/apache/cordova/CordovaWebViewClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebViewClient.java b/framework/src/org/apache/cordova/CordovaWebViewClient.java
index 1daf759..943003b 100755
--- a/framework/src/org/apache/cordova/CordovaWebViewClient.java
+++ b/framework/src/org/apache/cordova/CordovaWebViewClient.java
@@ -253,8 +253,8 @@ public class CordovaWebViewClient extends WebViewClient {
 
         // Shutdown if blank loaded
         if (url.equals("about:blank")) {
-            if (this.ctx.callbackServer != null) {
-                this.ctx.callbackServer.destroy();
+            if (appView.callbackServer != null) {
+                appView.callbackServer.destroy();
             }
             this.ctx.endActivity();
         }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/b99e9abb/framework/src/org/apache/cordova/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java
index 5f9e3bd..e6474bd 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -155,7 +155,6 @@ public class DroidGap extends Activity implements CordovaInterface {
 
     protected LinearLayout root;
     public boolean bound = false;
-    public CallbackServer callbackServer;
     protected boolean cancelLoadUrl = false;
     protected ProgressDialog spinnerDialog = null;
 
@@ -379,12 +378,12 @@ public class DroidGap extends Activity implements CordovaInterface {
                 me.appView.clearHistory();
             
                 // Create callback server and plugin manager
-                if (me.callbackServer == null) {
-                    me.callbackServer = new CallbackServer();
-                    me.callbackServer.init(url);
+                if (appView.callbackServer == null) {
+                    appView.callbackServer = new CallbackServer();
+                    appView.callbackServer.init(url);
                 }
                 else {
-                    me.callbackServer.reinit(url);
+                    appView.callbackServer.reinit(url);
                 }
                 appView.pluginManager.init();
                 
@@ -832,8 +831,8 @@ public class DroidGap extends Activity implements CordovaInterface {
      */
     public void sendJavascript(String statement) {
         //We need to check for the null case on the Kindle Fire beacuse it changes the width
and height on load
-        if(this.callbackServer != null)
-          this.callbackServer.sendJavascript(statement);
+        if(this.appView.callbackServer != null)
+          appView.callbackServer.sendJavascript(statement);
     }
 
     /**


Mime
View raw message