Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / android_webview / java / src / org / chromium / android_webview / AwWebContentsDelegate.java
1 // Copyright 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.
4
5 package org.chromium.android_webview;
6
7 import org.chromium.base.CalledByNative;
8 import org.chromium.base.JNINamespace;
9 import org.chromium.base.VisibleForTesting;
10 import org.chromium.components.web_contents_delegate_android.WebContentsDelegateAndroid;
11
12 /**
13  * WebView-specific WebContentsDelegate.
14  * This file is the Java version of the native class of the same name.
15  * It should contain abstract WebContentsDelegate methods to be implemented by the embedder.
16  * These methods belong to WebView but are not shared with the Chromium Android port.
17  */
18 @VisibleForTesting
19 @JNINamespace("android_webview")
20 public abstract class AwWebContentsDelegate extends WebContentsDelegateAndroid {
21     // Callback filesSelectedInChooser() when done.
22     @CalledByNative
23     public abstract void runFileChooser(int processId, int renderId, int modeFlags,
24             String acceptTypes, String title, String defaultFilename,  boolean capture);
25
26     @CalledByNative
27     public abstract boolean addNewContents(boolean isDialog, boolean isUserGesture);
28
29     @Override
30     @CalledByNative
31     public abstract void closeContents();
32
33     @Override
34     @CalledByNative
35     public abstract void activateContents();
36
37     @Override
38     @CalledByNative
39     public abstract void toggleFullscreenModeForTab(boolean enterFullscreen);
40
41     // Call in response to a prior runFileChooser call.
42     protected static native void nativeFilesSelectedInChooser(int processId, int renderId,
43             int modeFlags, String[] filePath, String[] displayName);
44 }