1 // Copyright (c) 2013 Intel Corporation. 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;
7 import android.util.Log;
9 class XWalkWebContentsDelegateAdapter extends XWalkWebContentsDelegate {
11 private XWalkContentsClient mXWalkContentsClient;
13 public XWalkWebContentsDelegateAdapter(XWalkContentsClient client) {
14 mXWalkContentsClient = client;
18 public void onLoadProgressChanged(int progress) {
19 if (mXWalkContentsClient != null) mXWalkContentsClient.onProgressChanged(progress);
23 public boolean addNewContents(boolean isDialog, boolean isUserGesture) {
29 public void closeContents() {
30 if (mXWalkContentsClient != null) mXWalkContentsClient.onCloseWindow();
34 public void activateContents() {
39 public void rendererUnresponsive() {
40 if (mXWalkContentsClient != null) mXWalkContentsClient.onRendererUnresponsive();
44 public void rendererResponsive() {
45 if (mXWalkContentsClient != null) mXWalkContentsClient.onRendererResponsive();
49 public void toggleFullscreen(boolean enterFullscreen) {
50 if (mXWalkContentsClient != null) mXWalkContentsClient.onToggleFullscreen(enterFullscreen);
54 public boolean isFullscreen() {
55 if (mXWalkContentsClient != null) return mXWalkContentsClient.hasEnteredFullscreen();
61 public boolean shouldOverrideRunFileChooser(int processId, int renderId, int mode,
62 String acceptTypes, boolean capture) {
63 if (mXWalkContentsClient != null) {
64 return mXWalkContentsClient.shouldOverrideRunFileChooser(processId, renderId, mode,
65 acceptTypes, capture);