mobile/android/base/GeckoViewChrome.java

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 package org.mozilla.gecko;
     8 public class GeckoViewChrome implements GeckoView.ChromeDelegate {
     9     /**
    10     * Tell the host application that Gecko is ready to handle requests.
    11     * @param view The GeckoView that initiated the callback.
    12     */
    13     public void onReady(GeckoView view) {}
    15     /**
    16     * Tell the host application to display an alert dialog.
    17     * @param view The GeckoView that initiated the callback.
    18     * @param browser The Browser that is loading the content.
    19     * @param message The string to display in the dialog.
    20     * @param result A PromptResult used to send back the result without blocking.
    21     * Defaults to cancel requests.
    22     */
    23     public void onAlert(GeckoView view, GeckoView.Browser browser, String message, GeckoView.PromptResult result) {
    24         result.cancel();
    25     }
    27     /**
    28     * Tell the host application to display a confirmation dialog.
    29     * @param view The GeckoView that initiated the callback.
    30     * @param browser The Browser that is loading the content.
    31     * @param message The string to display in the dialog.
    32     * @param result A PromptResult used to send back the result without blocking.
    33     * Defaults to cancel requests.
    34     */
    35     public void onConfirm(GeckoView view, GeckoView.Browser browser, String message, GeckoView.PromptResult result) {
    36         result.cancel();
    37     }
    39     /**
    40     * Tell the host application to display an input prompt dialog.
    41     * @param view The GeckoView that initiated the callback.
    42     * @param browser The Browser that is loading the content.
    43     * @param message The string to display in the dialog.
    44     * @param defaultValue The string to use as default input.
    45     * @param result A PromptResult used to send back the result without blocking.
    46     * Defaults to cancel requests.
    47     */
    48     public void onPrompt(GeckoView view, GeckoView.Browser browser, String message, String defaultValue, GeckoView.PromptResult result) {
    49         result.cancel();
    50     }
    52     /**
    53     * Tell the host application to display a remote debugging request dialog.
    54     * @param view The GeckoView that initiated the callback.
    55     * @param result A PromptResult used to send back the result without blocking.
    56     * Defaults to cancel requests.
    57     */
    58     public void onDebugRequest(GeckoView view, GeckoView.PromptResult result) {
    59         result.cancel();
    60     }
    61 }

mercurial