List of usage examples for org.apache.cordova NativeToJsMessageQueue NativeToJsMessageQueue
NativeToJsMessageQueue
From source file:org.crosswalk.engine.XWalkCordovaWebViewImpl.java
License:Apache License
@Override public void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences) { if (this.cordova != null) { throw new IllegalStateException(); }//from w w w .ja v a 2 s .c o m this.cordova = cordova; this.preferences = preferences; pluginManager = new PluginManager(this, this.cordova, pluginEntries); resourceApi = new CordovaResourceApi(engine.getView().getContext(), pluginManager); nativeToJsMessageQueue = new NativeToJsMessageQueue(); nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.NoOpBridgeMode()); nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.LoadUrlBridgeMode(engine, cordova)); if (preferences.getBoolean("DisallowOverscroll", false)) { engine.getView().setOverScrollMode(View.OVER_SCROLL_NEVER); } engine.init(this, cordova, engineClient, resourceApi, pluginManager, nativeToJsMessageQueue); // This isn't enforced by the compiler, so assert here. assert engine.getView() instanceof CordovaWebViewEngine.EngineView; pluginManager.addService(CoreAndroid.PLUGIN_NAME, "org.apache.cordova.CoreAndroid"); pluginManager.init(); }