Chromium Code Reviews| Index: webkit/glue/webframe_impl.cc |
| =================================================================== |
| --- webkit/glue/webframe_impl.cc (revision 14556) |
| +++ webkit/glue/webframe_impl.cc (working copy) |
| @@ -307,6 +307,10 @@ |
| printed_page_width_ = width; |
| WebCore::PrintContext::begin(printed_page_width_); |
| } |
| + float getPageShrink(int pageNumber) { |
| + 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 @@ |
| return true; |
| } |
| +float WebFrameImpl::GetPrintPageShrink(int page) { |
| + // Ensure correct state. |
| + if (!print_context_.get() || page < 0 || !frame() || !frame()->document()) { |
|
M-A Ruel
2009/04/27 18:41:13
I don't think it's worth looking at frame() or fra
|
| + 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()) { |