From e25490751cecc987506405e1d689a7141059fb89 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Fri, 23 Mar 2012 14:51:25 -0700 Subject: [PATCH] Creating the CordovaWebView, modifying DroidGap to use that --- .../org/apache/cordova/CordovaWebView.java | 26 +++++++++++++++++++ .../src/org/apache/cordova/DroidGap.java | 6 ++--- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 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 00000000..ff809925 --- /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); + } + +} diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index c48bf509..39d5c31a 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 whiteList = new ArrayList(); private HashMap whiteListCache = new HashMap(); @@ -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