Index: printing/printed_document.h |
diff --git a/printing/printed_document.h b/printing/printed_document.h |
index bdb092fc3223d6055f138c63c8de9443e75eda61..b253f72ed7fd9be9a543b405215373106ca5d287 100644 |
--- a/printing/printed_document.h |
+++ b/printing/printed_document.h |
@@ -32,10 +32,21 @@ class PrintingContext; |
class PRINTING_EXPORT PrintedDocument |
: public base::RefCountedThreadSafe<PrintedDocument> { |
public: |
+ // A delegate can be used to deviated the rendering of the pages to a |
+ // specific destination. |
+ class Delegate: public base::RefCountedThreadSafe<Delegate> { |
Albert Bodenhamer
2012/06/15 18:41:24
Perhaps "PrintDestinationInterface" instead of "De
MAD
2012/06/19 14:24:10
Good idea... Will do...
MAD
2012/06/28 15:48:14
Done.
|
+ public: |
+ virtual void SetPageCount(int page_count) = 0; |
+ virtual void SetPageContent(int page_number, |
+ void* content, |
+ size_t content_size) = 0; |
+ }; |
+ |
// The cookie shall be unique and has a specific relationship with its |
// originating source and settings. |
PrintedDocument(const PrintSettings& settings, |
PrintedPagesSource* source, |
+ Delegate* delegate, |
int cookie); |
// Sets a page's data. 0-based. Takes metafile ownership. |
@@ -136,7 +147,9 @@ class PRINTING_EXPORT PrintedDocument |
// any lock held. This is because it can't be changed after the object's |
// construction. |
struct Immutable { |
- Immutable(const PrintSettings& settings, PrintedPagesSource* source, |
+ Immutable(const PrintSettings& settings, |
+ PrintedPagesSource* source, |
+ Delegate* delegate, |
int cookie); |
~Immutable(); |
@@ -149,6 +162,9 @@ class PRINTING_EXPORT PrintedDocument |
// Document name. Immutable. |
string16 name_; |
+ // A potential Delegate where to redirect page rendering if not NULL. |
+ Delegate* delegate_; |
+ |
// Cookie to uniquely identify this document. It is used to make sure that a |
// PrintedPage is correctly belonging to the PrintedDocument. Since |
// PrintedPage generation is completely asynchronous, it could be easy to |