mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Add open folder dialog support (FILE_DIALOG_OPEN_FOLDER mode) for CefBrowserHost::RunFileDialog (issue #1030).
- Standardize file dialog behavior across all platforms (issue #1492). -- Show a file type filter list on OS X. -- Show the file extensions as part of the filter list description on all platforms (e.g. "Image Types (*.png;*.gif;*.jpg)"). -- Rename the CefBrowserHost::RunFileDialog |accept_types| argument to |accept_filters| and expand support for filters that will be displayed as-is in addition to the currently supported mime-type and extension-based filters. For example, a filter value of "Supported Image Types|.png;.gif;.jpg" will display "Supported Image Types (*.png;*.gif;*.jpg)" in the filter drop-down list and accept *.png, *.gif and *.jpg files. -- Persist the selected filter item index by passing a new |selected_accept_filter| argument to CefBrowserHost::RunFileDialog and returning the newly selected index via the CefRunFileDialogCallback and CefFileDialogCallback callbacks. -- Rename the CefBrowserHost::RunFileDialog |default_file_name| argument to |default_file_path| and use the directory component, if any, to set the default directory location. If |default_file_path| ends in a trailing path separator it will be treated as a directory without a file name component. -- Add FILE_DIALOG_OVERWRITEPROMPT_FLAG and FILE_DIALOG_HIDEREADONLY_FLAG values to cef_file_dialog_mode_t for controlling those behaviors where possible. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1973 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -195,13 +195,15 @@ typedef struct _cef_run_file_dialog_callback_t {
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called asynchronously after the file dialog is dismissed. If the selection
|
||||
// was successful |file_paths| will be a single value or a list of values
|
||||
// depending on the dialog mode. If the selection was cancelled |file_paths|
|
||||
// will be NULL.
|
||||
// Called asynchronously after the file dialog is dismissed.
|
||||
// |selected_accept_filter| is the 0-based index of the value selected from
|
||||
// the accept filters array passed to cef_browser_host_t::RunFileDialog.
|
||||
// |file_paths| will be a single value or a list of values depending on the
|
||||
// dialog mode. If the selection was cancelled |file_paths| will be NULL.
|
||||
///
|
||||
void (CEF_CALLBACK *cont)(struct _cef_run_file_dialog_callback_t* self,
|
||||
struct _cef_browser_host_t* browser_host, cef_string_list_t file_paths);
|
||||
void (CEF_CALLBACK *on_file_dialog_dismissed)(
|
||||
struct _cef_run_file_dialog_callback_t* self, int selected_accept_filter,
|
||||
cef_string_list_t file_paths);
|
||||
} cef_run_file_dialog_callback_t;
|
||||
|
||||
|
||||
@@ -315,17 +317,22 @@ typedef struct _cef_browser_host_t {
|
||||
// Call to run a file chooser dialog. Only a single file chooser dialog may be
|
||||
// pending at any given time. |mode| represents the type of dialog to display.
|
||||
// |title| to the title to be used for the dialog and may be NULL to show the
|
||||
// default title ("Open" or "Save" depending on the mode). |default_file_name|
|
||||
// is the default file name to select in the dialog. |accept_types| is a list
|
||||
// of valid lower-cased MIME types or file extensions specified in an input
|
||||
// element and is used to restrict selectable files to such types. |callback|
|
||||
// will be executed after the dialog is dismissed or immediately if another
|
||||
// dialog is already pending. The dialog will be initiated asynchronously on
|
||||
// the UI thread.
|
||||
// default title ("Open" or "Save" depending on the mode). |default_file_path|
|
||||
// is the path with optional directory and/or file name component that will be
|
||||
// initially selected in the dialog. |accept_filters| are used to restrict the
|
||||
// selectable file types and may any combination of (a) valid lower-cased MIME
|
||||
// types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g.
|
||||
// ".txt" or ".png"), or (c) combined description and file extension delimited
|
||||
// using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg").
|
||||
// |selected_accept_filter| is the 0-based index of the filter that will be
|
||||
// selected by default. |callback| will be executed after the dialog is
|
||||
// dismissed or immediately if another dialog is already pending. The dialog
|
||||
// will be initiated asynchronously on the UI thread.
|
||||
///
|
||||
void (CEF_CALLBACK *run_file_dialog)(struct _cef_browser_host_t* self,
|
||||
cef_file_dialog_mode_t mode, const cef_string_t* title,
|
||||
const cef_string_t* default_file_name, cef_string_list_t accept_types,
|
||||
const cef_string_t* default_file_path, cef_string_list_t accept_filters,
|
||||
int selected_accept_filter,
|
||||
struct _cef_run_file_dialog_callback_t* callback);
|
||||
|
||||
///
|
||||
|
Reference in New Issue
Block a user