org.openqa.selenium.android.library
Class DefaultChromeClient

java.lang.Object
  extended by android.webkit.WebChromeClient
      extended by org.openqa.selenium.android.library.DefaultChromeClient
All Implemented Interfaces:
DriverProvider, ViewProvider

public class DefaultChromeClient
extends android.webkit.WebChromeClient
implements DriverProvider, ViewProvider

Default implementation for WebDriver's chrome client. This chrome client allows WebDriver to listen to interesting events on the page. Note that this class handles the creation and destruction of new windows. onCreateWindow will create a new view using the ViewFactory provided to WebDriver. onCloseWindow will destroy the view.


Nested Class Summary
 
Nested classes/interfaces inherited from class android.webkit.WebChromeClient
android.webkit.WebChromeClient.CustomViewCallback
 
Constructor Summary
DefaultChromeClient()
          Default chrome client.
DefaultChromeClient(android.webkit.WebChromeClient client)
          Use this constructor if the WebView you are using with WebDriver does have custom setting defined in the WebChromeClient.
 
Method Summary
 android.graphics.Bitmap getDefaultVideoPoster()
           
 android.view.View getVideoLoadingProgressView()
           
 void getVisitedHistory(android.webkit.ValueCallback<String[]> callback)
           
 void onCloseWindow(android.webkit.WebView window)
           
 boolean onConsoleMessage(android.webkit.ConsoleMessage consoleMessage)
           
 void onConsoleMessage(String message, int lineNumber, String sourceID)
           
 boolean onCreateWindow(android.webkit.WebView view, boolean dialog, boolean userGesture, android.os.Message resultMsg)
           
 void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize, long totalUsedQuota, android.webkit.WebStorage.QuotaUpdater quotaUpdater)
           
 void onGeolocationPermissionsHidePrompt()
           
 void onGeolocationPermissionsShowPrompt(String origin, android.webkit.GeolocationPermissions.Callback callback)
           
 void onHideCustomView()
           
 boolean onJsAlert(android.webkit.WebView view, String url, String message, android.webkit.JsResult result)
           
 boolean onJsBeforeUnload(android.webkit.WebView view, String url, String message, android.webkit.JsResult result)
           
 boolean onJsConfirm(android.webkit.WebView view, String url, String message, android.webkit.JsResult result)
           
 boolean onJsPrompt(android.webkit.WebView view, String url, String message, String defaultValue, android.webkit.JsPromptResult result)
           
 boolean onJsTimeout()
           
 void onProgressChanged(android.webkit.WebView view, int newProgress)
           
 void onReachedMaxAppCacheSize(long spaceNeeded, long totalUsedQuota, android.webkit.WebStorage.QuotaUpdater quotaUpdater)
           
 void onReceivedIcon(android.webkit.WebView view, android.graphics.Bitmap icon)
           
 void onReceivedTitle(android.webkit.WebView view, String title)
           
 void onReceivedTouchIconUrl(android.webkit.WebView view, String url, boolean precomposed)
           
 void onRequestFocus(android.webkit.WebView view)
           
 void onShowCustomView(android.view.View view, int requestedOrientation, android.webkit.WebChromeClient.CustomViewCallback callback)
           
 void onShowCustomView(android.view.View view, android.webkit.WebChromeClient.CustomViewCallback callback)
           
 void setDriver(AndroidWebDriver driver)
           
 void setWebDriverView(org.openqa.selenium.android.library.WebDriverView view)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultChromeClient

public DefaultChromeClient()
Default chrome client. Use this if the WebView you are using does not have custom settings in the WebChromeClient.


DefaultChromeClient

public DefaultChromeClient(android.webkit.WebChromeClient client)
Use this constructor if the WebView you are using with WebDriver does have custom setting defined in the WebChromeClient.

Parameters:
client - the WebChromeClient used by the WebView that WebDriver is driving.
Method Detail

setDriver

public void setDriver(AndroidWebDriver driver)
Specified by:
setDriver in interface DriverProvider

setWebDriverView

public void setWebDriverView(org.openqa.selenium.android.library.WebDriverView view)
Specified by:
setWebDriverView in interface ViewProvider

onCloseWindow

public void onCloseWindow(android.webkit.WebView window)
Overrides:
onCloseWindow in class android.webkit.WebChromeClient

onCreateWindow

public boolean onCreateWindow(android.webkit.WebView view,
                              boolean dialog,
                              boolean userGesture,
                              android.os.Message resultMsg)
Overrides:
onCreateWindow in class android.webkit.WebChromeClient

onRequestFocus

public void onRequestFocus(android.webkit.WebView view)
Overrides:
onRequestFocus in class android.webkit.WebChromeClient

onProgressChanged

public void onProgressChanged(android.webkit.WebView view,
                              int newProgress)
Overrides:
onProgressChanged in class android.webkit.WebChromeClient

onReceivedTitle

public void onReceivedTitle(android.webkit.WebView view,
                            String title)
Overrides:
onReceivedTitle in class android.webkit.WebChromeClient

onReceivedIcon

public void onReceivedIcon(android.webkit.WebView view,
                           android.graphics.Bitmap icon)
Overrides:
onReceivedIcon in class android.webkit.WebChromeClient

onReceivedTouchIconUrl

public void onReceivedTouchIconUrl(android.webkit.WebView view,
                                   String url,
                                   boolean precomposed)
Overrides:
onReceivedTouchIconUrl in class android.webkit.WebChromeClient

onShowCustomView

public void onShowCustomView(android.view.View view,
                             android.webkit.WebChromeClient.CustomViewCallback callback)
Overrides:
onShowCustomView in class android.webkit.WebChromeClient

onShowCustomView

public void onShowCustomView(android.view.View view,
                             int requestedOrientation,
                             android.webkit.WebChromeClient.CustomViewCallback callback)
Overrides:
onShowCustomView in class android.webkit.WebChromeClient

onHideCustomView

public void onHideCustomView()
Overrides:
onHideCustomView in class android.webkit.WebChromeClient

onJsAlert

public boolean onJsAlert(android.webkit.WebView view,
                         String url,
                         String message,
                         android.webkit.JsResult result)
Overrides:
onJsAlert in class android.webkit.WebChromeClient

onJsConfirm

public boolean onJsConfirm(android.webkit.WebView view,
                           String url,
                           String message,
                           android.webkit.JsResult result)
Overrides:
onJsConfirm in class android.webkit.WebChromeClient

onJsPrompt

public boolean onJsPrompt(android.webkit.WebView view,
                          String url,
                          String message,
                          String defaultValue,
                          android.webkit.JsPromptResult result)
Overrides:
onJsPrompt in class android.webkit.WebChromeClient

onJsBeforeUnload

public boolean onJsBeforeUnload(android.webkit.WebView view,
                                String url,
                                String message,
                                android.webkit.JsResult result)
Overrides:
onJsBeforeUnload in class android.webkit.WebChromeClient

onExceededDatabaseQuota

public void onExceededDatabaseQuota(String url,
                                    String databaseIdentifier,
                                    long currentQuota,
                                    long estimatedSize,
                                    long totalUsedQuota,
                                    android.webkit.WebStorage.QuotaUpdater quotaUpdater)
Overrides:
onExceededDatabaseQuota in class android.webkit.WebChromeClient

onReachedMaxAppCacheSize

public void onReachedMaxAppCacheSize(long spaceNeeded,
                                     long totalUsedQuota,
                                     android.webkit.WebStorage.QuotaUpdater quotaUpdater)
Overrides:
onReachedMaxAppCacheSize in class android.webkit.WebChromeClient

onGeolocationPermissionsShowPrompt

public void onGeolocationPermissionsShowPrompt(String origin,
                                               android.webkit.GeolocationPermissions.Callback callback)
Overrides:
onGeolocationPermissionsShowPrompt in class android.webkit.WebChromeClient

onGeolocationPermissionsHidePrompt

public void onGeolocationPermissionsHidePrompt()
Overrides:
onGeolocationPermissionsHidePrompt in class android.webkit.WebChromeClient

onJsTimeout

public boolean onJsTimeout()
Overrides:
onJsTimeout in class android.webkit.WebChromeClient

onConsoleMessage

public void onConsoleMessage(String message,
                             int lineNumber,
                             String sourceID)
Overrides:
onConsoleMessage in class android.webkit.WebChromeClient

onConsoleMessage

public boolean onConsoleMessage(android.webkit.ConsoleMessage consoleMessage)
Overrides:
onConsoleMessage in class android.webkit.WebChromeClient

getDefaultVideoPoster

public android.graphics.Bitmap getDefaultVideoPoster()
Overrides:
getDefaultVideoPoster in class android.webkit.WebChromeClient

getVideoLoadingProgressView

public android.view.View getVideoLoadingProgressView()
Overrides:
getVideoLoadingProgressView in class android.webkit.WebChromeClient

getVisitedHistory

public void getVisitedHistory(android.webkit.ValueCallback<String[]> callback)
Overrides:
getVisitedHistory in class android.webkit.WebChromeClient


Copyright © 2013. All Rights Reserved.