OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
| 7 import com.google.common.annotations.VisibleForTesting; |
| 8 |
7 import org.chromium.base.CalledByNative; | 9 import org.chromium.base.CalledByNative; |
8 import org.chromium.base.JNINamespace; | 10 import org.chromium.base.JNINamespace; |
9 import org.chromium.components.web_contents_delegate_android.WebContentsDelegate
Android; | 11 import org.chromium.components.web_contents_delegate_android.WebContentsDelegate
Android; |
10 | 12 |
11 /** | 13 /** |
12 * WebView-specific WebContentsDelegate. | 14 * WebView-specific WebContentsDelegate. |
13 * This file is the Java version of the native class of the same name. | 15 * This file is the Java version of the native class of the same name. |
14 * It should contain abstract WebContentsDelegate methods to be implemented by t
he embedder. | 16 * It should contain abstract WebContentsDelegate methods to be implemented by t
he embedder. |
15 * These methods belong to WebView but are not shared with the Chromium Android
port. | 17 * These methods belong to WebView but are not shared with the Chromium Android
port. |
16 */ | 18 */ |
| 19 @VisibleForTesting |
17 @JNINamespace("android_webview") | 20 @JNINamespace("android_webview") |
18 public abstract class AwWebContentsDelegate extends WebContentsDelegateAndroid { | 21 public abstract class AwWebContentsDelegate extends WebContentsDelegateAndroid { |
| 22 // Callback filesSelectedInChooser() when done. |
| 23 @CalledByNative |
| 24 public abstract void runFileChooser(int processId, int renderId, int mode_fl
ags, |
| 25 String acceptTypes, String title, String defaultFilename, boolean c
apture); |
| 26 |
19 @CalledByNative | 27 @CalledByNative |
20 public abstract boolean addNewContents(boolean isDialog, boolean isUserGestu
re); | 28 public abstract boolean addNewContents(boolean isDialog, boolean isUserGestu
re); |
21 | 29 |
22 @CalledByNative | 30 @CalledByNative |
23 public abstract void closeContents(); | 31 public abstract void closeContents(); |
24 | 32 |
25 @CalledByNative | 33 @CalledByNative |
26 public abstract void activateContents(); | 34 public abstract void activateContents(); |
27 | 35 |
28 /** | 36 /** |
29 * Report a change in the preferred size. | 37 * Report a change in the preferred size. |
30 * @param width preferred width in CSS pixels. | 38 * @param width preferred width in CSS pixels. |
31 * @param height scroll height of the document element in CSS pixels. | 39 * @param height scroll height of the document element in CSS pixels. |
32 */ | 40 */ |
33 @CalledByNative | 41 @CalledByNative |
34 public void updatePreferredSize(int widthCss, int heightCss) { | 42 public void updatePreferredSize(int widthCss, int heightCss) { |
35 } | 43 } |
| 44 |
| 45 // Call in response to a prior runFileChooser call. |
| 46 protected static native void nativeFilesSelectedInChooser(int processId, int
renderId, |
| 47 int mode_flags, String[] filePath); |
36 } | 48 } |
OLD | NEW |