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

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

Issue 7792085: Print Preview: Handling pending print to pdf requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 9 years, 3 months 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
Index: chrome/browser/ui/webui/print_preview_handler.h
diff --git a/chrome/browser/ui/webui/print_preview_handler.h b/chrome/browser/ui/webui/print_preview_handler.h
index 6be0cbf97636ad271bfd506c3a0cb237766ae84d..c74aece126efdcd176ace6eb5f215ae6cdb61fc3 100644
--- a/chrome/browser/ui/webui/print_preview_handler.h
+++ b/chrome/browser/ui/webui/print_preview_handler.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/printing/print_view_manager_observer.h"
#include "chrome/browser/ui/shell_dialogs.h"
@@ -19,6 +20,7 @@ class PrintSystemTaskProxy;
class TabContentsWrapper;
namespace base {
+class DictionaryValue;
class FundamentalValue;
class StringValue;
}
@@ -79,10 +81,14 @@ class PrintPreviewHandler : public WebUIMessageHandler,
// is a job settings JSON string.
void HandleGetPreview(const base::ListValue* args);
- // Gets the job settings from Web UI and initiate printing. First element of
+ // Gets the job settings from Web UI and initiate printing. First element of
// |args| is a job settings JSON string.
void HandlePrint(const base::ListValue* args);
+ // Handles printing to PDF. |settings| points to a dictionary containing all
+ // the print request parameters.
+ void HandlePrintToPdf(const base::DictionaryValue& settings);
+
// Handles the request to hide the preview tab for printing. |args| is unused.
void HandleHidePreview(const base::ListValue* args);
@@ -161,6 +167,9 @@ class PrintPreviewHandler : public WebUIMessageHandler,
// Clears initiator tab details for this preview tab.
void ClearInitiatorTabDetails();
+ // Posts a task to save to pdf at |print_to_pdf_path_|.
+ void PostPrintToPdfTask();
+
// Pointer to current print system.
scoped_refptr<printing::PrintBackend> print_backend_;
@@ -185,6 +194,10 @@ class PrintPreviewHandler : public WebUIMessageHandler,
// Whether we have already logged the number of printers this session.
bool has_logged_printers_count_;
+ // Holds the path to the print to pdf request. It is empty if no such request
+ // exists.
+ scoped_ptr<FilePath> print_to_pdf_path_;
+
DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler);
};
« no previous file with comments | « chrome/browser/ui/webui/print_preview_data_source.cc ('k') | chrome/browser/ui/webui/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698