michael@0: /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko; michael@0: michael@0: public class GeckoViewChrome implements GeckoView.ChromeDelegate { michael@0: /** michael@0: * Tell the host application that Gecko is ready to handle requests. michael@0: * @param view The GeckoView that initiated the callback. michael@0: */ michael@0: public void onReady(GeckoView view) {} michael@0: michael@0: /** michael@0: * Tell the host application to display an alert dialog. michael@0: * @param view The GeckoView that initiated the callback. michael@0: * @param browser The Browser that is loading the content. michael@0: * @param message The string to display in the dialog. michael@0: * @param result A PromptResult used to send back the result without blocking. michael@0: * Defaults to cancel requests. michael@0: */ michael@0: public void onAlert(GeckoView view, GeckoView.Browser browser, String message, GeckoView.PromptResult result) { michael@0: result.cancel(); michael@0: } michael@0: michael@0: /** michael@0: * Tell the host application to display a confirmation dialog. michael@0: * @param view The GeckoView that initiated the callback. michael@0: * @param browser The Browser that is loading the content. michael@0: * @param message The string to display in the dialog. michael@0: * @param result A PromptResult used to send back the result without blocking. michael@0: * Defaults to cancel requests. michael@0: */ michael@0: public void onConfirm(GeckoView view, GeckoView.Browser browser, String message, GeckoView.PromptResult result) { michael@0: result.cancel(); michael@0: } michael@0: michael@0: /** michael@0: * Tell the host application to display an input prompt dialog. michael@0: * @param view The GeckoView that initiated the callback. michael@0: * @param browser The Browser that is loading the content. michael@0: * @param message The string to display in the dialog. michael@0: * @param defaultValue The string to use as default input. michael@0: * @param result A PromptResult used to send back the result without blocking. michael@0: * Defaults to cancel requests. michael@0: */ michael@0: public void onPrompt(GeckoView view, GeckoView.Browser browser, String message, String defaultValue, GeckoView.PromptResult result) { michael@0: result.cancel(); michael@0: } michael@0: michael@0: /** michael@0: * Tell the host application to display a remote debugging request dialog. michael@0: * @param view The GeckoView that initiated the callback. michael@0: * @param result A PromptResult used to send back the result without blocking. michael@0: * Defaults to cancel requests. michael@0: */ michael@0: public void onDebugRequest(GeckoView view, GeckoView.PromptResult result) { michael@0: result.cancel(); michael@0: } michael@0: }