This class wraps a chrome client that must have the *same* API as
WebChromeClient. This chrome client will be used with the view used
by WebDriver to monitor events.
Sample usage:
// If the underlying view is a WebView, you can use WebDriver's default
// chrome client assuming you don't have any custom bahavior defined in
// WebView's WebChromeClient.
ChromeClientWrapper chromeClient = new ChromeClientWrapper(
"android.webkit.WebChromeClient",
new DefaultChromeClient());
// If the underlying view is a WebView, you can use WebDriver default
// chrome client with a custom WebChromeClient that defines the bahavior
// you want.
class MyCustomChromeClient extends WebChromeClient {
...
}
MyCustomChromeClient customChrome = new MyCustomChromeClient();
ChromeClientWrapper chromeClient = new ChromeClientWrapper(
"android.webkit.WebChromeClient",
new DefaultChromeClient(customChrome))
Note that WebDriver needs the DefaultChromeClient in order to be able
to listen to events that happen on the page. If you don't want to use
the DefaultChromeClient, you can write your own client under the condition
that your client calls all WebDriverChromeClient methods.