1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.xwalk.core.xwview.test;
7 import android.graphics.Bitmap;
8 import android.graphics.Picture;
9 import android.net.http.SslError;
10 import android.os.Message;
11 import android.view.KeyEvent;
12 import android.view.View;
13 import android.webkit.ConsoleMessage;
14 import android.webkit.ValueCallback;
15 import android.webkit.WebResourceResponse;
17 import org.xwalk.core.JsPromptResult;
18 import org.xwalk.core.JsResult;
19 import org.xwalk.core.SslErrorHandler;
20 import org.xwalk.core.XWalkContentsClient;
21 import org.xwalk.core.XWalkGeolocationPermissions;
22 import org.xwalk.core.XWalkHttpAuthHandler;
23 import org.xwalk.core.XWalkWebChromeClient;
26 * As a convience for tests that only care about specefic callbacks, this class provides
27 * empty implementations of all abstract methods.
29 public class NullContentsClient extends XWalkContentsClient {
31 public void onUnhandledKeyEvent(KeyEvent event) {
35 public void getVisitedHistory(ValueCallback<String[]> callback) {
39 public void doUpdateVisitedHistory(String url, boolean isReload) {
43 public void onProgressChanged(int progress) {
47 public WebResourceResponse shouldInterceptRequest(String url) {
52 public void onLoadResource(String url) {
56 public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
61 public void onReceivedSslError(SslErrorHandler handler, SslError error) {
65 public void onReceivedLoginRequest(String realm, String account, String args) {
69 public void onGeolocationPermissionsShowPrompt(String origin,
70 XWalkGeolocationPermissions.Callback callback) {
74 public void onGeolocationPermissionsHidePrompt() {
78 public void handleJsAlert(String url, String message, JsResult receiver) {
82 public void handleJsBeforeUnload(String url, String message, JsResult receiver) {
86 public void handleJsConfirm(String url, String message, JsResult receiver) {
90 public void handleJsPrompt(
91 String url, String message, String defaultValue, JsPromptResult receiver) {
95 public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches,
96 boolean isDoneCounting) {
100 public void onNewPicture(Picture picture) {
104 public void onPageStarted(String url) {
108 public void onPageFinished(String url) {
112 public void onReceivedError(int errorCode, String description, String failingUrl) {
116 public void onFormResubmission(Message dontResend, Message resend) {
117 dontResend.sendToTarget();
121 public void onDownloadStart(String url,
123 String contentDisposition,
125 long contentLength) {
129 public boolean onCreateWindow(boolean isDialog, boolean isUserGesture) {
134 public void onCloseWindow() {
138 public void onRequestFocus() {
142 public void onReceivedTouchIconUrl(String url, boolean precomposed) {
146 public void onReceivedIcon(Bitmap bitmap) {
150 public void onShowCustomView(View view, XWalkWebChromeClient.CustomViewCallback callback) {
154 public void onHideCustomView() {
158 public void onScaleChangedScaled(float oldScale, float newScale) {
162 protected View getVideoLoadingProgressView() {
167 public Bitmap getDefaultVideoPoster() {
172 public void didFinishLoad(String url) {
176 public void onReceivedHttpAuthRequest(XWalkHttpAuthHandler handler, String host, String realm) {
180 public boolean shouldOverrideUrlLoading(String url) {
185 public void onTitleChanged(String title) {
189 public void onToggleFullscreen(boolean enterFullscreen) {
193 public boolean isFullscreen() {
198 public void onRendererResponsive() {
202 public void onRendererUnresponsive() {