summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webframe_impl.cc
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-05 21:15:12 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-05 21:15:12 +0000
commit0b353361770ed87786d30f476e221aca4c3ee402 (patch)
treea57605456ca8a30b8829f55fdd801f36d57e6679 /webkit/glue/webframe_impl.cc
parent9e549b587a1ae933c30e8d1d187832573ff1aa1d (diff)
downloadchromium_src-0b353361770ed87786d30f476e221aca4c3ee402.zip
chromium_src-0b353361770ed87786d30f476e221aca4c3ee402.tar.gz
chromium_src-0b353361770ed87786d30f476e221aca4c3ee402.tar.bz2
Stop using the function computePageRects() duplicated in FrameChromium.cpp.
Use the code from PrintContext instead. Review URL: http://codereview.chromium.org/20058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webframe_impl.cc')
-rw-r--r--webkit/glue/webframe_impl.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index 7d382dd..7df51c5 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -97,6 +97,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "markup.h"
#include "Page.h"
#include "PlatformContextSkia.h"
+#include "PrintContext.h"
#include "RenderFrame.h"
#if defined(OS_WIN)
#include "RenderThemeChromiumWin.h"
@@ -1767,10 +1768,13 @@ int WebFrameImpl::ComputePageRects(const gfx::Size& page_size_px) {
// TODO(maruel): Weird. We don't do that.
// Everything is in pixels :(
// pages_ and page_height are actually output parameters.
- int page_height;
- WebCore::IntRect rect(0, 0, page_size_px.width(), page_size_px.height());
- computePageRectsForFrame(frame(), rect, 0, 0, 1.0, pages_, page_height);
- return pages_.size();
+ WebCore::FloatRect rect(0, 0,
+ static_cast<float>(page_size_px.width()),
+ static_cast<float>(page_size_px.height()));
+ WebCore::PrintContext print_context(frame());
+ float page_height;
+ print_context.computePageRects(rect, 0, 0, 1.0, page_height);
+ return print_context.pageCount();
}
void WebFrameImpl::GetPageRect(int page, gfx::Rect* page_size) const {