Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8386)

Unified Diff: chrome/browser/ui/webui/print_preview_handler.cc

Issue 8425008: PrintPreview:[MAC] Added "Open PDF In Preview" option to open the pdf in native preview app. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added a check to fix the TestErrorMessage unit test Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/print_preview_data_source.cc ('k') | printing/print_job_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc
index f3fb0df256b56abce76c6447717c20fe3fb83691..0f04e4afa16e0b2e3c553526d70af249bb4746a6 100644
--- a/chrome/browser/ui/webui/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview_handler.cc
@@ -401,18 +401,23 @@ void PrintPreviewHandler::HandlePrint(const ListValue* args) {
bool print_to_pdf = false;
settings->GetBoolean(printing::kSettingPrintToPDF, &print_to_pdf);
+ bool open_pdf_in_preview = false;
+#if defined(OS_MACOSX)
+ open_pdf_in_preview = settings->HasKey(printing::kSettingOpenPDFInPreview);
+#endif
+
settings->SetBoolean(printing::kSettingHeaderFooterEnabled, false);
bool is_cloud_printer = settings->HasKey(printing::kSettingCloudPrintId);
bool is_cloud_dialog = false;
settings->GetBoolean(printing::kSettingCloudPrintDialog, &is_cloud_dialog);
- if (is_cloud_printer) {
+ if (is_cloud_printer && !open_pdf_in_preview) {
std::string print_ticket;
args->GetString(1, &print_ticket);
SendCloudPrintJob(*settings, print_ticket);
- } else if (print_to_pdf) {
+ } else if (print_to_pdf && !open_pdf_in_preview) {
HandlePrintToPdf(*settings);
- } else if (is_cloud_dialog) {
+ } else if (is_cloud_dialog && !open_pdf_in_preview) {
HandlePrintWithCloudPrint();
} else {
ReportPrintSettingsStats(*settings);
« no previous file with comments | « chrome/browser/ui/webui/print_preview_data_source.cc ('k') | printing/print_job_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698