Creating the CordovaWebView, modifying DroidGap to use that

This commit is contained in:
Joe Bowser 2012-03-23 14:51:25 -07:00
parent 9d0e8fa436
commit e25490751c
2 changed files with 29 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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