Remove unused CordovaWebViewImpl parameter, and make pluginManager private

It was public by accident - with the final design leaving it public does
not help with backwards-compatibility.
This commit is contained in:
Andrew Grieve 2015-04-08 21:01:50 -04:00
parent a652d892ca
commit 2e9cbdcb0d
3 changed files with 7 additions and 8 deletions

View File

@ -185,7 +185,7 @@ public class CordovaActivity extends Activity {
* Override this to customize the webview that is used.
*/
protected CordovaWebView makeWebView() {
return new CordovaWebViewImpl(this, makeWebViewEngine());
return new CordovaWebViewImpl(makeWebViewEngine());
}
protected CordovaWebViewEngine makeWebViewEngine() {

View File

@ -48,8 +48,7 @@ public class CordovaWebViewImpl implements CordovaWebView {
public static final String TAG = "CordovaWebViewImpl";
// Public for backwards-compatibility :(
public PluginManager pluginManager;
private PluginManager pluginManager;
protected final CordovaWebViewEngine engine;
private CordovaInterface cordova;
@ -84,10 +83,10 @@ public class CordovaWebViewImpl implements CordovaWebView {
}
}
public CordovaWebViewImpl(Context context, CordovaWebViewEngine cordovaWebViewEngine) {
this.context = context;
public CordovaWebViewImpl(CordovaWebViewEngine cordovaWebViewEngine) {
this.engine = cordovaWebViewEngine;
}
// Convenience method for when creating programmatically (not from Config.xml).
public void init(CordovaInterface cordova) {
init(cordova, new ArrayList<PluginEntry>(), new CordovaPreferences());
@ -461,7 +460,6 @@ public class CordovaWebViewImpl implements CordovaWebView {
}
pluginManager.onStop();
}
@Override
public void handleDestroy() {
if (!isInitialized()) {
@ -473,7 +471,8 @@ public class CordovaWebViewImpl implements CordovaWebView {
// Forward to plugins
this.pluginManager.onDestroy();
// Load blank page so that JavaScript onunload is called
// TODO: about:blank is a bit special (and the default URL for new frames)
// We should use a blank data: url instead so it's more obvious
this.loadUrl("about:blank");
// TODO: Should not destroy webview until after about:blank is done loading.

View File

@ -62,7 +62,7 @@ public class CordovaWebViewTestActivity extends Activity {
parser.parse(this);
SystemWebView webView = (SystemWebView) findViewById(R.id.cordovaWebView);
cordovaWebView = new CordovaWebViewImpl(this, new SystemWebViewEngine(webView));
cordovaWebView = new CordovaWebViewImpl(new SystemWebViewEngine(webView));
cordovaWebView.init(cordovaInterface, parser.getPluginEntries(), parser.getPreferences());
cordovaWebView.loadUrl(START_URL);