Skip to content

Commit abb2bd0

Browse files
smilefxmagreenblatt
authored andcommitted
Add FILE_DIALOG_OPEN_FOLDER to CefBrowser.runFileDialog (fixes chromiumembedded#498)
1 parent 4902869 commit abb2bd0

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

java/org/cef/handler/CefDialogHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public interface CefDialogHandler {
2020
enum FileDialogMode {
2121
FILE_DIALOG_OPEN, //!< Requires that the file exists before allowing the user to pick it.
2222
FILE_DIALOG_OPEN_MULTIPLE, //!< Like Open, but allows picking multiple files to open.
23+
FILE_DIALOG_OPEN_FOLDER, //!< Like Open, but selects a folder to open.
2324
FILE_DIALOG_SAVE //!< Allows picking a nonexistent file, and prompts to overwrite if the
2425
//! file already exists.
2526
}

native/CefBrowser_N.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,10 @@ Java_org_cef_browser_CefBrowser_1N_N_1RunFileDialog(JNIEnv* env,
15801580
"org/cef/handler/CefDialogHandler$FileDialogMode",
15811581
"FILE_DIALOG_OPEN_MULTIPLE")) {
15821582
mode = FILE_DIALOG_OPEN_MULTIPLE;
1583+
} else if (IsJNIEnumValue(env, jmode,
1584+
"org/cef/handler/CefDialogHandler$FileDialogMode",
1585+
"FILE_DIALOG_OPEN_FOLDER")) {
1586+
mode = FILE_DIALOG_OPEN_FOLDER;
15831587
} else if (IsJNIEnumValue(env, jmode,
15841588
"org/cef/handler/CefDialogHandler$FileDialogMode",
15851589
"FILE_DIALOG_SAVE")) {

native/dialog_handler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ bool DialogHandler::OnFileDialog(
5858
FILE_DIALOG_OPEN, jmode);
5959
JNI_CASE(env, "org/cef/handler/CefDialogHandler$FileDialogMode",
6060
FILE_DIALOG_OPEN_MULTIPLE, jmode);
61+
JNI_CASE(env, "org/cef/handler/CefDialogHandler$FileDialogMode",
62+
FILE_DIALOG_OPEN_FOLDER, jmode);
6163
JNI_CASE(env, "org/cef/handler/CefDialogHandler$FileDialogMode",
6264
FILE_DIALOG_SAVE, jmode);
6365
}

0 commit comments

Comments
 (0)