Forward user gesture to PPAPI plugin |
|||
Issue descriptionWe're working on crbug.com/61248 and we're hung up on an input problem: when saving the PDF through clicking the Download/Save button on the toolbar, the lack of a user gesture/activation on the plugin itself prevents a file chooser dialog to appear. For context, open any pdf, for example https://www.justice.gov/ust/eo/bapcpa/uniform_final_rpts/20090901/docs/7-NFR-Acroform.pdf to see the toolbar. The Download button currently just redownloads a copy of the open document. When filling a form, the information filled in is not saved. This is crbug.com/61248. We're trying to fix this by opening a PepperFileChooser and then writing a new PDF with the filled-in data to the chosen location. https://chromium-review.googlesource.com/c/chromium/src/+/1155257/ is a WIP CL that does that. The reason PepperFileChooserHost::OnShow() fails is this check: if (!host()->permissions().HasPermission( ppapi::PERMISSION_BYPASS_USER_GESTURE) && !renderer_ppapi_host_->HasUserGesture(pp_instance())) { return PP_ERROR_NO_USER_GESTURE; } The toolbar is not inside the PPAPI plugin, even though it sends an event to the plugin through JS https://cs.chromium.org/chromium/src/chrome/browser/resources/pdf/pdf_viewer.js?l=512&rcl=c8ce6bcf304347e03fd7448966ae028e1d90bcae which is handled by https://cs.chromium.org/chromium/src/pdf/out_of_process_instance.cc?l=654&rcl=c8ce6bcf304347e03fd7448966ae028e1d90bcae The event path for a [click in the toolbar save button] vs a [click in the plugin area]: https://paste.googleplex.com/6385041009541120 In the [click in the plugin area] case, the plugin saves a user gesture here: https://cs.chromium.org/chromium/src/pdf/out_of_process_instance.cc?l=654&rcl=c8ce6bcf304347e03fd7448966ae028e1d90bcae For the [click in the toolbar save button], we need some way to forward the user gesture to the plugin.
,
Aug 14
With UAv2, token forwarding should be be unnecessary. The plugins would need to access current activation state instead but I suspect there is no Frame involved here. So we can't do anything until we have browser-side triggering. We don't want to fix the old (v1) code just for this.
,
Aug 14
A few questions: 1. What's the roadmap for UAv2? 2. I tried enabling the UAv2 flag and nothing changed for the purposes of this bug. Should something have changed? 3. What is browser-side triggering?
,
Oct 10
,
Oct 11
hnakashima@: Do you need anything more here after Issue 61248 is fixed? I assumed that the file chooser dialog is now evoked from the wrapper frame as we discussed few weeks ago, so user gesture is no longer a blocker for you.
,
Oct 11
No, I think we won't need this to be changed after all, given the implementation in https://chromium-review.googlesource.com/c/1211662 is working. Thank you for the helping us figure out a workaround!
,
Oct 11
|
|||
►
Sign in to add a comment |
|||
Comment 1 by nzolghadr@chromium.org
, Aug 3Components: Blink>Input
Owner: mustaq@chromium.org
Status: Assigned (was: Untriaged)