The default file dialog implementations provided by CEF currently behave
somewhat differently on different platforms. For example:
- Filter items are listed differently on different platforms, and not listed at
all on OS X.
- There's currently no way to persist the selected filter item across dialog
runs.
- There's currently no way to specify the default directory versus selected
file name.
- There's currently no way to toggle "hide read-only files" or "prompt on
overwrite" behaviors.
Standardize the file dialog behavior as follows:
1. Show a file type filter list on OS X.
2. Show the file extensions as part of the filter list description on all
platforms (e.g. "Image Types (*.png;*.gif;*.jpg)").
3. 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.
4. 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.
5. 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.
6. Add FILE_DIALOG_OVERWRITEPROMPT_FLAG and FILE_DIALOG_HIDEREADONLY_FLAG
values to cef_file_dialog_mode_t for controlling those behaviors where possible.
Original issue reported on code.google.com by magreenb...@gmail.com on 16 Jan 2015 at 10:03
Original issue reported on code.google.com by
magreenb...@gmail.com
on 16 Jan 2015 at 10:03