Hook up IDC_SAVEPAGE to the PDF plugin.

Implement the plumbing from the PDF plugin out to MimeHandlerViewGuest,
so the plugin can let the browser know whether it is able to handle PDF
saving internally.

On the browser side, add WebContentsDelegate::GuestSaveFrame(). When the
user asks the browser to save a PDF, the request reaches
WebContentsImpl::SaveFrameWithHeaders(). Here, the embedder WebContents
can check for the existance of a guest WebContents and use
GuestSaveFrame() to ask the guest to perform the save. GuestSaveFrame()
calls into MimeHandlerViewGuest, which knows whether the plugin can or
not.

When the plugin can save, MimeHandlerViewGuest will dispatch an event to
the PDF Viewer to trigger the same code as when the user presses the
Save button in the PDF Viewer. The PDF Viewer already knows how to talk
to the plugin to save PDFs via its own Save button.

BUG=61248

Change-Id: I11fc00dec99445faaeb1771ea071dbffc99b6c14
Reviewed-on: https://chromium-review.googlesource.com/c/1447264
Reviewed-by: Ehsan Karamad <ekaramad@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#633448}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 13a42e48261590d8d816df00d0f2b49eae1b0eb2
9 files changed