org.apache.cordova.CordovaChromeClient Java Examples

The following examples show how to use org.apache.cordova.CordovaChromeClient. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CordovaWebViewTestActivity.java    From crosswalk-cordova-android with Apache License 2.0 6 votes vote down vote up
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    //CB-7238: This has to be added now, because it got removed from somewhere else
    Config.init(this);
    
    cordovaWebView = (CordovaWebView) findViewById(R.id.cordovaWebView);
    cordovaWebView.init(this, new CordovaWebViewClient(this, cordovaWebView), new CordovaChromeClient(this, cordovaWebView),
            Config.getPluginEntries(), Config.getWhitelist(), Config.getExternalWhitelist(), Config.getPreferences());

    cordovaWebView.loadUrl("file:///android_asset/www/index.html");

}
 
Example #2
Source File: CordovaWebViewTestActivity.java    From cordova-amazon-fireos with Apache License 2.0 5 votes vote down vote up
/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
//        AWV Factory should be initialized before setting the layout  
        if (!sFactoryInit) {
           factory = AmazonWebKitFactories.getDefaultFactory();
           if (factory.isRenderProcess(this)) {
               return; // Do nothing if this is on render process
           }
          factory.initialize(this);
           
           sFactoryInit = true;
       } else {
           factory = AmazonWebKitFactories.getDefaultFactory();
       }

        setContentView(R.layout.main);

        //CB-7238: This has to be added now, because it got removed from somewhere else
        Config.init(this);
        
        cordovaWebView = (CordovaWebView) findViewById(R.id.cordovaWebView);
        factory.initializeWebView(cordovaWebView, 0xFFFFFF, false, null);
        cordovaWebView.init(this, new CordovaWebViewClient(this, cordovaWebView), new CordovaChromeClient(this, cordovaWebView),
                Config.getPluginEntries(), Config.getWhitelist(), Config.getExternalWhitelist(), Config.getPreferences());

        cordovaWebView.loadUrl("file:///android_asset/www/index.html");

    }
 
Example #3
Source File: UserWebViewTest.java    From cordova-android-chromeview with Apache License 2.0 4 votes vote down vote up
public void customTest()
{
  assertTrue(CordovaWebView.class.isInstance(testView));
  assertTrue(CordovaWebViewClient.class.isInstance(testActivity.testViewClient));
  assertTrue(CordovaChromeClient.class.isInstance(testActivity.testChromeClient));
}
 
Example #4
Source File: whitelist.java    From cordova-android-chromeview with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.init(new CordovaWebView(this), new TestViewClient(this), new CordovaChromeClient(this));
    super.loadUrl("file:///android_asset/www/whitelist/index.html");
}