summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webframe_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/webframe_impl.cc')
-rw-r--r--webkit/glue/webframe_impl.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index dfed0aa..3b87d4f 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -307,6 +307,10 @@ class ChromePrintContext : public WebCore::PrintContext {
printed_page_width_ = width;
WebCore::PrintContext::begin(printed_page_width_);
}
+ float getPageShrink(int pageNumber) const {
+ IntRect pageRect = m_pageRects[pageNumber];
+ return printed_page_width_ / pageRect.width();
+ }
// Spools the printed page, a subrect of m_frame.
// Skip the scale step. NativeTheme doesn't play well with scaling. Scaling
// is done browser side instead.
@@ -1884,6 +1888,16 @@ bool WebFrameImpl::BeginPrint(const WebSize& page_size_px,
return true;
}
+float WebFrameImpl::GetPrintPageShrink(int page) {
+ // Ensure correct state.
+ if (!print_context_.get() || page < 0) {
+ NOTREACHED();
+ return 0;
+ }
+
+ return print_context_->getPageShrink(page);
+}
+
float WebFrameImpl::PrintPage(int page, skia::PlatformCanvas* canvas) {
// Ensure correct state.
if (!print_context_.get() || page < 0 || !frame() || !frame()->document()) {