summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/mock_printer.h
diff options
context:
space:
mode:
authoraayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-17 22:04:58 +0000
committeraayushkumar@chromium.org <aayushkumar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-17 22:04:58 +0000
commit540ac80c83db3f4865d007288a4f1b8524e0aa86 (patch)
tree949f85a92cd501baef2827c063e3476ae27bb97c /chrome/renderer/mock_printer.h
parent6895bf926cba01ef455bb7327703aa5378a46488 (diff)
downloadchromium_src-540ac80c83db3f4865d007288a4f1b8524e0aa86.zip
chromium_src-540ac80c83db3f4865d007288a4f1b8524e0aa86.tar.gz
chromium_src-540ac80c83db3f4865d007288a4f1b8524e0aa86.tar.bz2
Added Header and Footer support in Linux, Windows and Mac for Skia
BUG=67514 TEST= In the preview tab, note added options for printing headers and footers. Toggle with the checkbox and ensure that the correct headers and footers are displayed. Review URL: http://codereview.chromium.org/7348010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/mock_printer.h')
-rw-r--r--chrome/renderer/mock_printer.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/chrome/renderer/mock_printer.h b/chrome/renderer/mock_printer.h
index 0ae5687..326a50d 100644
--- a/chrome/renderer/mock_printer.h
+++ b/chrome/renderer/mock_printer.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/string16.h"
#include "printing/image.h"
#include "ui/gfx/size.h"
@@ -134,9 +135,66 @@ class MockPrinter {
bool is_first_request_;
int preview_request_id_;
+ // Used for displaying headers and footers.
+ bool display_header_footer_;
+ string16 date_;
+ string16 title_;
+ string16 url_;
+
std::vector<scoped_refptr<MockPrinterPage> > pages_;
DISALLOW_COPY_AND_ASSIGN(MockPrinter);
};
+// A clone of PrintMsg_Print_Params struct.
+class PrintMsg_Print_Params_Clone {
+ public:
+ PrintMsg_Print_Params_Clone();
+ ~PrintMsg_Print_Params_Clone();
+
+ // Resets the members of |params| to 0. Checks to see if
+ // PrintMsg_Print_Params and PrintMsg_Print_Params_Clone have identical
+ // member variables.
+ void ResetParams(PrintMsg_Print_Params* params);
+
+ private:
+ gfx::Size page_size_;
+ gfx::Size printable_size_;
+ int margin_top_;
+ int margin_left_;
+ double dpi_;
+ double min_shrink_;
+ double max_shrink_;
+ int desired_dpi_;
+ int document_cookie_;
+ bool selection_only_;
+ bool supports_alpha_blend_;
+ int preview_request_id_;
+ bool is_first_request_;
+ bool display_header_footer_;
+ string16 date_;
+ string16 title_;
+ string16 url_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrintMsg_Print_Params_Clone);
+};
+
+// A clone of PrintMsg_PrintPages_Params struct.
+class PrintMsg_PrintPages_Params_Clone {
+ public:
+ PrintMsg_PrintPages_Params_Clone();
+ ~PrintMsg_PrintPages_Params_Clone();
+
+ // Resets the members of |params| to 0. Checks to see if
+ // PrintMsg_PrintPages_Params and PrintMsg_PrintPages_Params_Clone have
+ // identical member variables.
+ void ResetParams(PrintMsg_PrintPages_Params* params);
+
+ private:
+ PrintMsg_Print_Params_Clone params_;
+ std::vector<int> pages_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrintMsg_PrintPages_Params_Clone);
+};
+
#endif // CHROME_RENDERER_MOCK_PRINTER_H_