summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcraig.schlenter@chromium.org <craig.schlenter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 16:22:14 +0000
committercraig.schlenter@chromium.org <craig.schlenter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 16:22:14 +0000
commit16ea4b4de1a0ca36389ac2767478816f0b3cc19e (patch)
treed4640cf5d24707d971beef56908e238ac2e0ad0b
parent9ea23e8565ba4cddc3e93b7a819d4cc473e5600a (diff)
downloadchromium_src-16ea4b4de1a0ca36389ac2767478816f0b3cc19e.zip
chromium_src-16ea4b4de1a0ca36389ac2767478816f0b3cc19e.tar.gz
chromium_src-16ea4b4de1a0ca36389ac2767478816f0b3cc19e.tar.bz2
Make PrintWebViewHelper::PrintPageAsJPEG compile on Mac.
Review URL: http://codereview.chromium.org/197026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25456 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/print_web_view_helper.cc7
-rw-r--r--chrome/renderer/print_web_view_helper.h4
2 files changed, 6 insertions, 5 deletions
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index 633acd8..d23bef2 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -16,6 +16,7 @@
#include "webkit/api/public/WebScreenInfo.h"
#include "webkit/api/public/WebSize.h"
#include "webkit/api/public/WebURLRequest.h"
+#include "webkit/glue/webkit_glue.h"
using WebKit::WebFrame;
using WebKit::WebRect;
@@ -139,7 +140,7 @@ void PrintWebViewHelper::PrintPages(const ViewMsg_PrintPages_Params& params,
}
}
}
-#ifndef OS_MACOSX
+
void PrintWebViewHelper::PrintPageAsJPEG(
const ViewMsg_PrintPage_Params& params,
WebFrame* frame,
@@ -159,7 +160,7 @@ void PrintWebViewHelper::PrintPageAsJPEG(
// Access the bitmap from the canvas device.
skia::PlatformCanvas canvas(size_x, size_y, true);
- frame->printPage(params.page_number, &canvas);
+ frame->printPage(params.page_number, webkit_glue::ToWebCanvas(&canvas));
const SkBitmap& bitmap = canvas.getDevice()->accessBitmap(false);
// Encode the SkBitmap to jpeg.
@@ -174,7 +175,7 @@ void PrintWebViewHelper::PrintPageAsJPEG(
image_data);
DCHECK(encoded);
}
-#endif
+
bool PrintWebViewHelper::Send(IPC::Message* msg) {
return render_view_->Send(msg);
}
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index 0c49884..406c807 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -74,7 +74,7 @@ class PrintWebViewHelper : public WebViewDelegate {
// Notification when printing is done - signal teardown
void DidFinishPrinting(bool success);
-#ifndef OS_MACOSX
+
// 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|.
@@ -82,7 +82,7 @@ class PrintWebViewHelper : public WebViewDelegate {
WebKit::WebFrame* frame,
float zoom_factor,
std::vector<unsigned char>* image_data);
-#endif
+
protected:
bool CopyAndPrint(const ViewMsg_PrintPages_Params& params,
WebKit::WebFrame* web_frame);