mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-07 23:03:11 +08:00
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:
parent
a652d892ca
commit
2e9cbdcb0d
@ -185,7 +185,7 @@ public class CordovaActivity extends Activity {
|
|||||||
* Override this to customize the webview that is used.
|
* Override this to customize the webview that is used.
|
||||||
*/
|
*/
|
||||||
protected CordovaWebView makeWebView() {
|
protected CordovaWebView makeWebView() {
|
||||||
return new CordovaWebViewImpl(this, makeWebViewEngine());
|
return new CordovaWebViewImpl(makeWebViewEngine());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CordovaWebViewEngine makeWebViewEngine() {
|
protected CordovaWebViewEngine makeWebViewEngine() {
|
||||||
|
@ -48,8 +48,7 @@ public class CordovaWebViewImpl implements CordovaWebView {
|
|||||||
|
|
||||||
public static final String TAG = "CordovaWebViewImpl";
|
public static final String TAG = "CordovaWebViewImpl";
|
||||||
|
|
||||||
// Public for backwards-compatibility :(
|
private PluginManager pluginManager;
|
||||||
public PluginManager pluginManager;
|
|
||||||
|
|
||||||
protected final CordovaWebViewEngine engine;
|
protected final CordovaWebViewEngine engine;
|
||||||
private CordovaInterface cordova;
|
private CordovaInterface cordova;
|
||||||
@ -84,10 +83,10 @@ public class CordovaWebViewImpl implements CordovaWebView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CordovaWebViewImpl(Context context, CordovaWebViewEngine cordovaWebViewEngine) {
|
public CordovaWebViewImpl(CordovaWebViewEngine cordovaWebViewEngine) {
|
||||||
this.context = context;
|
|
||||||
this.engine = cordovaWebViewEngine;
|
this.engine = cordovaWebViewEngine;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convenience method for when creating programmatically (not from Config.xml).
|
// Convenience method for when creating programmatically (not from Config.xml).
|
||||||
public void init(CordovaInterface cordova) {
|
public void init(CordovaInterface cordova) {
|
||||||
init(cordova, new ArrayList<PluginEntry>(), new CordovaPreferences());
|
init(cordova, new ArrayList<PluginEntry>(), new CordovaPreferences());
|
||||||
@ -461,7 +460,6 @@ public class CordovaWebViewImpl implements CordovaWebView {
|
|||||||
}
|
}
|
||||||
pluginManager.onStop();
|
pluginManager.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleDestroy() {
|
public void handleDestroy() {
|
||||||
if (!isInitialized()) {
|
if (!isInitialized()) {
|
||||||
@ -473,7 +471,8 @@ public class CordovaWebViewImpl implements CordovaWebView {
|
|||||||
// Forward to plugins
|
// Forward to plugins
|
||||||
this.pluginManager.onDestroy();
|
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");
|
this.loadUrl("about:blank");
|
||||||
|
|
||||||
// TODO: Should not destroy webview until after about:blank is done loading.
|
// TODO: Should not destroy webview until after about:blank is done loading.
|
||||||
|
@ -62,7 +62,7 @@ public class CordovaWebViewTestActivity extends Activity {
|
|||||||
parser.parse(this);
|
parser.parse(this);
|
||||||
|
|
||||||
SystemWebView webView = (SystemWebView) findViewById(R.id.cordovaWebView);
|
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.init(cordovaInterface, parser.getPluginEntries(), parser.getPreferences());
|
||||||
|
|
||||||
cordovaWebView.loadUrl(START_URL);
|
cordovaWebView.loadUrl(START_URL);
|
||||||
|
Loading…
Reference in New Issue
Block a user