summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/print_web_view_helper.h
diff options
context:
space:
mode:
authormhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 12:22:45 +0000
committermhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 12:22:45 +0000
commit1f6079539a1ffb2a17579f22280f476895d2414c (patch)
tree53a928f2167e28750be8b50fbdae58f9c2aae9dd /chrome/renderer/print_web_view_helper.h
parent1156a8e6ba080e8890e2a9695bd75c34800d0808 (diff)
downloadchromium_src-1f6079539a1ffb2a17579f22280f476895d2414c.zip
chromium_src-1f6079539a1ffb2a17579f22280f476895d2414c.tar.gz
chromium_src-1f6079539a1ffb2a17579f22280f476895d2414c.tar.bz2
Implement PrintPageAsJPEG feature for Print Preview.In order to show the tab contents to the print tab, the renderer should print the page as a JPEG image so it could be rendered in the DOMUI. A unit test case has been created to make sure the image contains something from deciding whether its not 100% white.MockPrinter has been altered to remove the const parameter, since its useful to retrieve the DefaultSettings not via IPC.BUG=173 (http://crbug.com/173)TEST=created a unit test and ran it.
Review URL: http://codereview.chromium.org/196021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25445 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper.h')
-rw-r--r--chrome/renderer/print_web_view_helper.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index 0c2f0ff..406c807 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -75,6 +75,14 @@ class PrintWebViewHelper : public WebViewDelegate {
// Notification when printing is done - signal teardown
void DidFinishPrinting(bool success);
+ // Prints the page listed in |params| as a JPEG image. The width and height of
+ // the image will scale propotionally given the |zoom_factor| multiplier. The
+ // encoded JPEG data will be written into the supplied vector |image_data|.
+ void PrintPageAsJPEG(const ViewMsg_PrintPage_Params& params,
+ WebKit::WebFrame* frame,
+ float zoom_factor,
+ std::vector<unsigned char>* image_data);
+
protected:
bool CopyAndPrint(const ViewMsg_PrintPages_Params& params,
WebKit::WebFrame* web_frame);