Add delegate function to open a new file
Since the media_app in the guest frame can't use any file system api functions we need some IPC so the guest frame can ask the parent frame to show the open file picker. This cl adds a delegate function which allows for this functionality, the parent frame will show the picker and insert the picked file into the navigation order after the current file. Note that since we navigate to the new file via a normal call to "advance" the media app will show a dialog asking users if they are sure they want to navigate if they have unsaved changes. If they click cancel the get into a weird state where clicking "next" will make them jump forward a file. Finding a way to deal with this is tracked in b/163662946. Additionally this updates the externs for "showOpenFilePicker" so it now returns a FileSystemFileHandle, not a fileSystemHandle. This is consistent with both the spec: https://wicg.github.io/native-file-system/#dom-window-showopenfilepicker and the implementation: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/native_file_system/window_native_file_system.idl;l=17;drc=0c6b1827bb42907302eac1e1a24f93768fc89985 Bug: b/147395281 Change-Id: I199bc787b2f69e6cd5f6785fb4f94556cd1438cc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352954 Commit-Queue: Zain Afzal <zafzal@google.com> Reviewed-by:Trent Apted <tapted@chromium.org> Cr-Commit-Position: refs/heads/master@{#798058}
Showing
Please register or sign in to comment