summaryrefslogtreecommitdiffstats
path: root/pdf/out_of_process_instance.cc
diff options
context:
space:
mode:
authorsammc <sammc@chromium.org>2014-11-19 15:27:40 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-19 23:27:59 +0000
commit92af61555dff60e1d1b51c47d27d07c5a643726d (patch)
tree0b9f83a6e76178ee019838d6bddadc0d4a9185c5 /pdf/out_of_process_instance.cc
parentb45f55be7958e1a2dbd30261c10436b49829782d (diff)
downloadchromium_src-92af61555dff60e1d1b51c47d27d07c5a643726d.zip
chromium_src-92af61555dff60e1d1b51c47d27d07c5a643726d.tar.gz
chromium_src-92af61555dff60e1d1b51c47d27d07c5a643726d.tar.bz2
OOP PDF: Change the save toolbar button to match the save menu behavior.
Previously, the save toolbar button for the out-of-process PDF plugin was a link to the PDF URL. This did not function for file URLs or PDFs returned in response to a POST. This changes the button to use the pepper PDF save API and adds a way for a WebContentsDelegate to override SaveFrame behavior so the MimeHandlerViewGuest can instruct its embedder to handle the actual save. BUG=416329 TEST=Run with --out-of-process-pdf. Open a local PDF and click the save toolbar button. The save as dialog should appear. Repeat the same with a PDF returned by a POST request. Saving should save the opened PDF - not the page returned by a GET to the same URL. Review URL: https://codereview.chromium.org/706823004 Cr-Commit-Position: refs/heads/master@{#304920}
Diffstat (limited to 'pdf/out_of_process_instance.cc')
-rw-r--r--pdf/out_of_process_instance.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index e195067..4854961 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -85,6 +85,8 @@ const char kJSGetPasswordCompleteType[] = "getPasswordComplete";
const char kJSPassword[] = "password";
// Print (Page -> Plugin)
const char kJSPrintType[] = "print";
+// Save (Page -> Plugin)
+const char kJSSaveType[] = "save";
// Go to page (Plugin -> Page)
const char kJSGoToPageType[] = "goToPage";
const char kJSPageNumber[] = "page";
@@ -404,6 +406,8 @@ void OutOfProcessInstance::HandleMessage(const pp::Var& message) {
}
} else if (type == kJSPrintType) {
Print();
+ } else if (type == kJSSaveType) {
+ pp::PDF::SaveAs(this);
} else if (type == kJSRotateClockwiseType) {
RotateClockwise();
} else if (type == kJSRotateCounterclockwiseType) {