New issue
Advanced search Search tips

Issue 870820 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Oct 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Forward user gesture to PPAPI plugin

Project Member Reported by hnakashima@chromium.org, Aug 3

Issue description

We'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.
 
Cc: -mustaq@chromium.org nzolghadr@chromium.org
Components: Blink>Input
Owner: mustaq@chromium.org
Status: Assigned (was: Untriaged)
mustaq@ could you take a look at this one? Did we have any plans for plugins in UAv2?
Blockedon: 848778
Labels: UserActivation
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.
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?
Blocking: -61248
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.
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!
Blockedon: -848778
Status: WontFix (was: Assigned)
Thanks for the fix there.

Sign in to add a comment