Added requestSaveFile ipc to chrome://media-app.
Google3 side of this change: ccl/320140322. When we do a save copy operation we have to prompt the user to choose a destination but for security reasons our call to saveFilePicker has to be tied to a user gesture and needs to be triggered within a certain timeframe of the user gesture being registered. Our current flow for save copy is to do an encode of the current image then trigger the file picker,sometimes this takes so long that our time window expires and our call to saveFilePicker gets blocked by security policies. This cl adds a new delegate function called "requestSaveFile" which does just the step of calling showFilePicker to create a file handler allowing us to do the actual file write later on once the encode is done. As such SaveCopy now takes in a file token which the client gets from requestSaveFile. Additionally since this CL will land before the google3 side has been rolled in saveCopy will still respect the old interface, calling requestSaveFile implicitly if a token is not provided. Change-Id: I0d06803cae819163c54f38bbcd170d064c78c316 bug: b/160658703 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2291810 Commit-Queue: Zain Afzal <zafzal@google.com> Reviewed-by:Trent Apted <tapted@chromium.org> Cr-Commit-Position: refs/heads/master@{#787952}
Showing
Please register or sign in to comment