You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2012/03/23 23:01:17 UTC

[17/17] android commit: Creating the CordovaWebView, modifying DroidGap to use that

Creating the CordovaWebView, modifying DroidGap to use that


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/e2549075
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/e2549075
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/e2549075

Branch: refs/heads/CordovaWebView
Commit: e25490751cecc987506405e1d689a7141059fb89
Parents: 9d0e8fa
Author: Joe Bowser <bo...@apache.org>
Authored: Fri Mar 23 14:51:25 2012 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Fri Mar 23 14:51:25 2012 -0700

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaWebView.java     |   26 +++++++++++++++
 framework/src/org/apache/cordova/DroidGap.java     |    6 ++--
 2 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/e2549075/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
new file mode 100644
index 0000000..ff80992
--- /dev/null
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -0,0 +1,26 @@
+package org.apache.cordova;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.webkit.WebView;
+
+public class CordovaWebView extends WebView {
+
+  public CordovaWebView(Context context) {
+    super(context);
+  }
+  
+  public CordovaWebView(Context context, AttributeSet attrs) {
+    super(context, attrs);
+  }
+  
+  public CordovaWebView(Context context, AttributeSet attrs, int defStyle) {
+    super(context, attrs, defStyle);
+  }
+  
+  public CordovaWebView(Context context, AttributeSet attrs, int defStyle,
+      boolean privateBrowsing) {
+    super(context, attrs, defStyle, privateBrowsing);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/e2549075/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 c48bf50..39d5c31 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -150,7 +150,7 @@ public class DroidGap extends Activity implements CordovaInterface {
     public static String TAG = "DroidGap";
     
     // The webview for our app
-    protected WebView appView;
+    protected CordovaWebView appView;
     protected WebViewClient webViewClient;
     private ArrayList<Pattern> whiteList = new ArrayList<Pattern>();
     private HashMap<String, Boolean> whiteListCache = new HashMap<String,Boolean>();
@@ -349,7 +349,7 @@ public class DroidGap extends Activity implements CordovaInterface {
      * Create and initialize web container with default web view objects.
      */
     public void init() {
-    	this.init(new WebView(DroidGap.this), new CordovaWebViewClient(this), new CordovaChromeClient(DroidGap.this));
+    	this.init(new CordovaWebView(DroidGap.this), new CordovaWebViewClient(this), new CordovaChromeClient(DroidGap.this));
     }
     
     /**
@@ -359,7 +359,7 @@ public class DroidGap extends Activity implements CordovaInterface {
      * @param webViewClient
      * @param webChromeClient
      */
-    public void init(WebView webView, WebViewClient webViewClient, WebChromeClient webChromeClient) {
+    public void init(CordovaWebView webView, WebViewClient webViewClient, WebChromeClient webChromeClient) {
         LOG.d(TAG, "DroidGap.init()");
         
         // Set up web container