IT. Expert System.

Android Reference

WebChromeClient


android.webkit

Class WebChromeClient



  • public class WebChromeClient
    extends Object
    • Constructor Detail

      • WebChromeClient

        public WebChromeClient()
    • Method Detail

      • onProgressChanged

        public void onProgressChanged(WebView view,
                             int newProgress)
        Tell the host application the current progress of loading a page.
        Parameters:
        view - The WebView that initiated the callback.
        newProgress - Current page loading progress, represented by an integer between 0 and 100.
      • onReceivedTitle

        public void onReceivedTitle(WebView view,
                           String title)
        Notify the host application of a change in the document title.
        Parameters:
        view - The WebView that initiated the callback.
        title - A String containing the new title of the document.
      • onReceivedIcon

        public void onReceivedIcon(WebView view,
                          Bitmap icon)
        Notify the host application of a new favicon for the current page.
        Parameters:
        view - The WebView that initiated the callback.
        icon - A Bitmap containing the favicon for the current page.
      • onReceivedTouchIconUrl

        public void onReceivedTouchIconUrl(WebView view,
                                  String url,
                                  boolean precomposed)
        Notify the host application of the url for an apple-touch-icon.
        Parameters:
        view - The WebView that initiated the callback.
        url - The icon url.
        precomposed - True if the url is for a precomposed touch icon.
      • onShowCustomView

        public void onShowCustomView(View view,
                            WebChromeClient.CustomViewCallback callback)
        Notify the host application that the current page would like to show a custom View.
        Parameters:
        view - is the View object to be shown.
        callback - is the callback to be invoked if and when the view is dismissed.
      • onShowCustomView

        public void onShowCustomView(View view,
                            int requestedOrientation,
                            WebChromeClient.CustomViewCallback callback)
        Notify the host application that the current page would like to show a custom View in a particular orientation.
        Parameters:
        view - is the View object to be shown.
        requestedOrientation - An orientation constant as used in ActivityInfo.screenOrientation.
        callback - is the callback to be invoked if and when the view is dismissed.
      • onHideCustomView

        public void onHideCustomView()
        Notify the host application that the current page would like to hide its custom view.
      • onCreateWindow

        public boolean onCreateWindow(WebView view,
                             boolean isDialog,
                             boolean isUserGesture,
                             Message resultMsg)
        Request the host application to create a new window. If the host application chooses to honor this request, it should return true from this method, create a new WebView to host the window, insert it into the View system and send the supplied resultMsg message to its target with the new WebView as an argument. If the host application chooses not to honor the request, it should return false from this method. The default implementation of this method does nothing and hence returns false.
        Parameters:
        view - The WebView from which the request for a new window originated.
        isDialog - True if the new window should be a dialog, rather than a full-size window.
        isUserGesture - True if the request was initiated by a user gesture, such as the user clicking a link.
        resultMsg - The message to send when once a new WebView has been created. resultMsg.obj is a WebView.WebViewTransport object. This should be used to transport the new WebView, by calling WebView.WebViewTransport.setWebView(WebView).
        Returns:
        This method should return true if the host application will create a new window, in which case resultMsg should be sent to its target. Otherwise, this method should return false. Returning false from this method but also sending resultMsg will result in undefined behavior.
      • onRequestFocus

        public void onRequestFocus(WebView view)
        Request display and focus for this WebView. This may happen due to another WebView opening a link in this WebView and requesting that this WebView be displayed.
        Parameters:
        view - The WebView that needs to be focused.
      • onCloseWindow

        public void onCloseWindow(WebView window)
        Notify the host application to close the given WebView and remove it from the view system if necessary. At this point, WebCore has stopped any loading in this window and has removed any cross-scripting ability in javascript.
        Parameters:
        window - The WebView that needs to be closed.
      • onJsAlert

        public boolean onJsAlert(WebView view,
                        String url,
                        String message,
                        JsResult result)
        Tell the client to display a javascript alert dialog. If the client returns true, WebView will assume that the client will handle the dialog. If the client returns false, it will continue execution.
        Parameters:
        view - The WebView that initiated the callback.
        url - The url of the page requesting the dialog.
        message - Message to be displayed in the window.
        result - A JsResult to confirm that the user hit enter.
        Returns:
        boolean Whether the client will handle the alert dialog.
      • onJsConfirm

        public boolean onJsConfirm(WebView view,
                          String url,
                          String message,
                          JsResult result)
        Tell the client to display a confirm dialog to the user. If the client returns true, WebView will assume that the client will handle the confirm dialog and call the appropriate JsResult method. If the client returns false, a default value of false will be returned to javascript. The default behavior is to return false.
        Parameters:
        view - The WebView that initiated the callback.
        url - The url of the page requesting the dialog.
        message - Message to be displayed in the window.
        result - A JsResult used to send the user's response to javascript.
        Returns:
        boolean Whether the client will handle the confirm dialog.
      • onJsPrompt

        public boolean onJsPrompt(WebView view,
                         String url,
                         String message,
                         String defaultValue,
                         JsPromptResult result)
        Tell the client to display a prompt dialog to the user. If the client returns true, WebView will assume that the client will handle the prompt dialog and call the appropriate JsPromptResult method. If the client returns false, a default value of false will be returned to to javascript. The default behavior is to return false.
        Parameters:
        view - The WebView that initiated the callback.
        url - The url of the page requesting the dialog.
        message - Message to be displayed in the window.
        defaultValue - The default value displayed in the prompt dialog.
        result - A JsPromptResult used to send the user's reponse to javascript.
        Returns:
        boolean Whether the client will handle the prompt dialog.
      • onJsBeforeUnload

        public boolean onJsBeforeUnload(WebView view,
                               String url,
                               String message,
                               JsResult result)
        Tell the client to display a dialog to confirm navigation away from the current page. This is the result of the onbeforeunload javascript event. If the client returns true, WebView will assume that the client will handle the confirm dialog and call the appropriate JsResult method. If the client returns false, a default value of true will be returned to javascript to accept navigation away from the current page. The default behavior is to return false. Setting the JsResult to true will navigate away from the current page, false will cancel the navigation.
        Parameters:
        view - The WebView that initiated the callback.
        url - The url of the page requesting the dialog.
        message - Message to be displayed in the window.
        result - A JsResult used to send the user's response to javascript.
        Returns:
        boolean Whether the client will handle the confirm dialog.
      • onExceededDatabaseQuota

        public void onExceededDatabaseQuota(String url,
                                   String databaseIdentifier,
                                   long quota,
                                   long estimatedDatabaseSize,
                                   long totalQuota,
                                   WebStorage.QuotaUpdater quotaUpdater)
        Tell the client that the quota has been exceeded for the Web SQL Database API for a particular origin and request a new quota. The client must respond by invoking the updateQuota(long) method of the supplied WebStorage.QuotaUpdater instance. The minimum value that can be set for the new quota is the current quota. The default implementation responds with the current quota, so the quota will not be increased.
        Parameters:
        url - The URL of the page that triggered the notification
        databaseIdentifier - The identifier of the database where the quota was exceeded.
        quota - The quota for the origin, in bytes
        estimatedDatabaseSize - The estimated size of the offending database, in bytes
        totalQuota - The total quota for all origins, in bytes
        quotaUpdater - An instance of WebStorage.QuotaUpdater which must be used to inform the WebView of the new quota.
      • onReachedMaxAppCacheSize

        public void onReachedMaxAppCacheSize(long requiredStorage,
                                    long quota,
                                    WebStorage.QuotaUpdater quotaUpdater)
        Notify the host application that the Application Cache has reached the maximum size. The client must respond by invoking the updateQuota(long) method of the supplied WebStorage.QuotaUpdater instance. The minimum value that can be set for the new quota is the current quota. The default implementation responds with the current quota, so the quota will not be increased.
        Parameters:
        requiredStorage - The amount of storage required by the Application Cache operation that triggered this notification, in bytes.
        quota - the current maximum Application Cache size, in bytes
        quotaUpdater - An instance of WebStorage.QuotaUpdater which must be used to inform the WebView of the new quota.
      • onGeolocationPermissionsShowPrompt

        public void onGeolocationPermissionsShowPrompt(String origin,
                                              GeolocationPermissions.Callback callback)
        Notify the host application that web content from the specified origin is attempting to use the Geolocation API, but no permission state is currently set for that origin. The host application should invoke the specified callback with the desired permission state. See GeolocationPermissions for details.
        Parameters:
        origin - The origin of the web content attempting to use the Geolocation API.
        callback - The callback to use to set the permission state for the origin.
      • onGeolocationPermissionsHidePrompt

        public void onGeolocationPermissionsHidePrompt()
        Notify the host application that a request for Geolocation permissions, made with a previous call to onGeolocationPermissionsShowPrompt() has been canceled. Any related UI should therefore be hidden.
      • onJsTimeout

        public boolean onJsTimeout()
        Deprecated. This method is no longer supported and will not be invoked.
        Tell the client that a JavaScript execution timeout has occured. And the client may decide whether or not to interrupt the execution. If the client returns true, the JavaScript will be interrupted. If the client returns false, the execution will continue. Note that in the case of continuing execution, the timeout counter will be reset, and the callback will continue to occur if the script does not finish at the next check point.
        Returns:
        boolean Whether the JavaScript execution should be interrupted.
      • onConsoleMessage

        @Deprecated
        public void onConsoleMessage(String message,
                                       int lineNumber,
                                       String sourceID)
        Deprecated. Use onConsoleMessage(ConsoleMessage) instead.
        Report a JavaScript error message to the host application. The ChromeClient should override this to process the log message as they see fit.
        Parameters:
        message - The error message to report.
        lineNumber - The line number of the error.
        sourceID - The name of the source file that caused the error.
      • onConsoleMessage

        public boolean onConsoleMessage(ConsoleMessage consoleMessage)
        Report a JavaScript console message to the host application. The ChromeClient should override this to process the log message as they see fit.
        Parameters:
        consoleMessage - Object containing details of the console message.
        Returns:
        true if the message is handled by the client.
      • getDefaultVideoPoster

        public Bitmap getDefaultVideoPoster()
        When not playing, video elements are represented by a 'poster' image. The image to use can be specified by the poster attribute of the video tag in HTML. If the attribute is absent, then a default poster will be used. This method allows the ChromeClient to provide that default image.
        Returns:
        Bitmap The image to use as a default poster, or null if no such image is available.
      • getVideoLoadingProgressView

        public View getVideoLoadingProgressView()
        When the user starts to playback a video element, it may take time for enough data to be buffered before the first frames can be rendered. While this buffering is taking place, the ChromeClient can use this function to provide a View to be displayed. For example, the ChromeClient could show a spinner animation.
        Returns:
        View The View to be displayed whilst the video is loading.
      • getVisitedHistory

        public void getVisitedHistory(ValueCallback<String[]> callback)
        Obtains a list of all visited history items, used for link coloring
      • openFileChooser

        public void openFileChooser(ValueCallback<Uri> uploadFile,
                           String acceptType,
                           String capture)
        Tell the client to open a file chooser.
        Parameters:
        uploadFile - A ValueCallback to set the URI of the file to upload. onReceiveValue must be called to wake up the thread.a
        acceptType - The value of the 'accept' attribute of the input tag associated with this file picker.
        capture - The value of the 'capture' attribute of the input tag associated with this file picker.
      • setupAutoFill

        public void setupAutoFill(Message msg)
        Tell the client that the page being viewed has an autofillable form and the user would like to set a profile up.
        Parameters:
        msg - A Message to send once the user has successfully set up a profile and to inform the WebTextView it should now autofill using that new profile.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1408 / . Delta: 0.01935 с