1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/GeckoViewChrome.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 +/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +package org.mozilla.gecko; 1.10 + 1.11 +public class GeckoViewChrome implements GeckoView.ChromeDelegate { 1.12 + /** 1.13 + * Tell the host application that Gecko is ready to handle requests. 1.14 + * @param view The GeckoView that initiated the callback. 1.15 + */ 1.16 + public void onReady(GeckoView view) {} 1.17 + 1.18 + /** 1.19 + * Tell the host application to display an alert dialog. 1.20 + * @param view The GeckoView that initiated the callback. 1.21 + * @param browser The Browser that is loading the content. 1.22 + * @param message The string to display in the dialog. 1.23 + * @param result A PromptResult used to send back the result without blocking. 1.24 + * Defaults to cancel requests. 1.25 + */ 1.26 + public void onAlert(GeckoView view, GeckoView.Browser browser, String message, GeckoView.PromptResult result) { 1.27 + result.cancel(); 1.28 + } 1.29 + 1.30 + /** 1.31 + * Tell the host application to display a confirmation dialog. 1.32 + * @param view The GeckoView that initiated the callback. 1.33 + * @param browser The Browser that is loading the content. 1.34 + * @param message The string to display in the dialog. 1.35 + * @param result A PromptResult used to send back the result without blocking. 1.36 + * Defaults to cancel requests. 1.37 + */ 1.38 + public void onConfirm(GeckoView view, GeckoView.Browser browser, String message, GeckoView.PromptResult result) { 1.39 + result.cancel(); 1.40 + } 1.41 + 1.42 + /** 1.43 + * Tell the host application to display an input prompt dialog. 1.44 + * @param view The GeckoView that initiated the callback. 1.45 + * @param browser The Browser that is loading the content. 1.46 + * @param message The string to display in the dialog. 1.47 + * @param defaultValue The string to use as default input. 1.48 + * @param result A PromptResult used to send back the result without blocking. 1.49 + * Defaults to cancel requests. 1.50 + */ 1.51 + public void onPrompt(GeckoView view, GeckoView.Browser browser, String message, String defaultValue, GeckoView.PromptResult result) { 1.52 + result.cancel(); 1.53 + } 1.54 + 1.55 + /** 1.56 + * Tell the host application to display a remote debugging request dialog. 1.57 + * @param view The GeckoView that initiated the callback. 1.58 + * @param result A PromptResult used to send back the result without blocking. 1.59 + * Defaults to cancel requests. 1.60 + */ 1.61 + public void onDebugRequest(GeckoView view, GeckoView.PromptResult result) { 1.62 + result.cancel(); 1.63 + } 1.64 +}