Skip to content

Commit

Permalink
Moved the initialization of the IceCreamWebViewClient to CordovaWebVi…
Browse files Browse the repository at this point in the history
…ew, we weren't loading the fix in properly after the refactor - CB-1742
  • Loading branch information
infil00p committed Oct 25, 2012
1 parent 0eee229 commit 6aafd6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions framework/src/org/apache/cordova/CordovaWebView.java
Expand Up @@ -122,6 +122,7 @@ public CordovaWebView(Context context) {
{
Log.d(TAG, "Your activity must implement CordovaInterface to work");
}
this.initWebViewClient(this.cordova);
this.loadConfiguration();
this.setup();
}
Expand Down Expand Up @@ -167,7 +168,6 @@ public CordovaWebView(Context context, AttributeSet attrs, int defStyle) {
Log.d(TAG, "Your activity must implement CordovaInterface to work");
}
this.setWebChromeClient(new CordovaChromeClient(this.cordova, this));
this.initWebViewClient(this.cordova);
this.loadConfiguration();
this.setup();
}
Expand Down Expand Up @@ -199,7 +199,7 @@ public CordovaWebView(Context context, AttributeSet attrs, int defStyle, boolean


private void initWebViewClient(CordovaInterface cordova) {
if(android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.HONEYCOMB)
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)
{
this.setWebViewClient(new CordovaWebViewClient(this.cordova, this));
}
Expand Down
6 changes: 2 additions & 4 deletions framework/src/org/apache/cordova/DroidGap.java
Expand Up @@ -301,7 +301,7 @@ public Activity getActivity() {
*/
public void init() {
CordovaWebView webView = new CordovaWebView(DroidGap.this);
this.init(webView, new CordovaWebViewClient(this, webView), new CordovaChromeClient(this, webView));
this.init(webView, new CordovaChromeClient(this, webView));
}

/**
Expand All @@ -311,16 +311,14 @@ public void init() {
* @param webViewClient
* @param webChromeClient
*/
public void init(CordovaWebView webView, CordovaWebViewClient webViewClient, CordovaChromeClient webChromeClient) {
public void init(CordovaWebView webView, CordovaChromeClient webChromeClient) {
LOG.d(TAG, "DroidGap.init()");

// Set up web container
this.appView = webView;
this.appView.setId(100);

this.appView.setWebViewClient(webViewClient);
this.appView.setWebChromeClient(webChromeClient);
webViewClient.setWebView(this.appView);
webChromeClient.setWebView(this.appView);

this.appView.setLayoutParams(new LinearLayout.LayoutParams(
Expand Down

0 comments on commit 6aafd6d

Please sign in to comment.