summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--webkit/build/WebCore/SConscript1
-rw-r--r--webkit/build/WebCore/WebCore.vcproj12
-rw-r--r--webkit/glue/webframe_impl.cc12
-rw-r--r--webkit/webkit.xcodeproj/project.pbxproj30
4 files changed, 37 insertions, 18 deletions
diff --git a/webkit/build/WebCore/SConscript b/webkit/build/WebCore/SConscript
index e2ca4f7..1733a69 100644
--- a/webkit/build/WebCore/SConscript
+++ b/webkit/build/WebCore/SConscript
@@ -407,6 +407,7 @@ input_files = [
'$WEBCORE_DIR/page/NavigatorBase.cpp',
'$WEBCORE_DIR/page/Page.cpp',
'$WEBCORE_DIR/page/PageGroup.cpp',
+ '$WEBCORE_DIR/page/PrintContext.cpp',
'$WEBCORE_DIR/page/Screen.cpp',
'$WEBCORE_DIR/page/SecurityOrigin.cpp',
'$WEBCORE_DIR/page/Settings.cpp',
diff --git a/webkit/build/WebCore/WebCore.vcproj b/webkit/build/WebCore/WebCore.vcproj
index 554b618..9e3966b 100644
--- a/webkit/build/WebCore/WebCore.vcproj
+++ b/webkit/build/WebCore/WebCore.vcproj
@@ -445,6 +445,14 @@
>
</File>
<File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\page\PrintContext.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\page\PrintContext.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\third_party\WebKit\WebCore\page\Screen.cpp"
>
</File>
@@ -555,6 +563,10 @@
RelativePath="..\..\..\third_party\WebKit\WebCore\page\chromium\FrameChromium.cpp"
>
</File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\page\chromium\FrameChromium.h"
+ >
+ </File>
</Filter>
</Filter>
<Filter
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 {
diff --git a/webkit/webkit.xcodeproj/project.pbxproj b/webkit/webkit.xcodeproj/project.pbxproj
index 7a7531a..35f96a1 100644
--- a/webkit/webkit.xcodeproj/project.pbxproj
+++ b/webkit/webkit.xcodeproj/project.pbxproj
@@ -56,6 +56,7 @@
4DB7F5420E9BD50600C66CE0 /* MainThreadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4DB7F5410E9BD50600C66CE0 /* MainThreadMac.mm */; };
4DB7F55D0E9BD66300C66CE0 /* V8XMLHttpRequestCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB7F55B0E9BD66300C66CE0 /* V8XMLHttpRequestCustom.cpp */; };
4DB7FE770E9BF6D800C66CE0 /* WebSystemInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DB7FE6A0E9BF69A00C66CE0 /* WebSystemInterface.m */; };
+ 4DFEF7850F3B818C00F73D51 /* PrintContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D1640E20EC29BB4008F024E /* PrintContext.cpp */; };
535EE0C00EC4D10E00939D54 /* clipboard_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 535EE0BE0EC4D10E00939D54 /* clipboard_conversion.cc */; };
5379C0CA0F2A841A0092C7DF /* WorkerThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5379C0C90F2A841A0092C7DF /* WorkerThread.cpp */; };
5379C0D70F2A845E0092C7DF /* Worker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5379C0CC0F2A845E0092C7DF /* Worker.cpp */; };
@@ -8594,13 +8595,15 @@
9384442F0F16B0570075F4C5 /* BindingURI.cpp in Sources */,
938444300F16B0570075F4C5 /* BitmapImage.cpp in Sources */,
938444310F16B0570075F4C5 /* BlockExceptions.mm in Sources */,
+ 93EF1C090F214F260070601B /* BMPImageDecoder.cpp in Sources */,
+ 93EF1C0A0F214F260070601B /* BMPImageReader.cpp in Sources */,
938444320F16B0570075F4C5 /* break_lines.cpp in Sources */,
938444330F16B0570075F4C5 /* BreakBlockquoteCommand.cpp in Sources */,
938444340F16B0570075F4C5 /* Cache.cpp in Sources */,
938444350F16B0570075F4C5 /* CachedCSSStyleSheet.cpp in Sources */,
938444360F16B0570075F4C5 /* CachedFont.cpp in Sources */,
- 938444370F16B0570075F4C5 /* CachedImage.cpp in Sources */,
B52EC2550F2FE07B0051A2C4 /* CachedFrame.cpp in Sources */,
+ 938444370F16B0570075F4C5 /* CachedImage.cpp in Sources */,
938444380F16B0570075F4C5 /* CachedPage.cpp in Sources */,
938444390F16B0570075F4C5 /* CachedResource.cpp in Sources */,
9384443A0F16B0570075F4C5 /* CachedResourceClientWalker.cpp in Sources */,
@@ -8789,7 +8792,8 @@
938444ED0F16B0570075F4C5 /* Geolocation.cpp in Sources */,
938444EE0F16B0570075F4C5 /* GeolocationService.cpp in Sources */,
938444EF0F16B0570075F4C5 /* Geoposition.cpp in Sources */,
- 938444F00F16B0570075F4C5 /* KURLGoogle.cpp in Sources */,
+ 93EF1C0B0F214F260070601B /* GIFImageDecoder.cpp in Sources */,
+ 93EF1C0C0F214F260070601B /* GIFImageReader.cpp in Sources */,
938444F10F16B0570075F4C5 /* GlyphPageTreeNode.cpp in Sources */,
938444F20F16B0570075F4C5 /* GlyphPageTreeNodeMac.cpp in Sources */,
938444F30F16B0570075F4C5 /* GlyphWidthMap.cpp in Sources */,
@@ -8886,10 +8890,10 @@
9384454E0F16B0570075F4C5 /* HTMLViewSourceDocument.cpp in Sources */,
53AAC3940F291FCF00233688 /* HTTPHeaderMap.cpp in Sources */,
9384454F0F16B0570075F4C5 /* HTTPParsers.cpp in Sources */,
+ 93EF1C0D0F214F260070601B /* ICOImageDecoder.cpp in Sources */,
938445500F16B0570075F4C5 /* IconChromiumMac.cpp in Sources */,
938445510F16B0570075F4C5 /* IconDatabaseNone.cpp in Sources */,
938445520F16B0570075F4C5 /* IconLoader.cpp in Sources */,
- B58DCCE90F27DF0100BF697A /* InputElement.cpp in Sources */,
938445530F16B0570075F4C5 /* Image.cpp in Sources */,
938445540F16B0570075F4C5 /* ImageBufferCG.cpp in Sources */,
938445550F16B0570075F4C5 /* ImageCG.cpp in Sources */,
@@ -8903,6 +8907,7 @@
9384455D0F16B0570075F4C5 /* InlineBox.cpp in Sources */,
9384455E0F16B0570075F4C5 /* InlineFlowBox.cpp in Sources */,
9384455F0F16B0570075F4C5 /* InlineTextBox.cpp in Sources */,
+ B58DCCE90F27DF0100BF697A /* InputElement.cpp in Sources */,
938445600F16B0570075F4C5 /* InsertIntoTextNodeCommand.cpp in Sources */,
938445610F16B0570075F4C5 /* InsertLineBreakCommand.cpp in Sources */,
938445620F16B0570075F4C5 /* InsertListCommand.cpp in Sources */,
@@ -8915,9 +8920,11 @@
938445690F16B0570075F4C5 /* IntRectCG.cpp in Sources */,
9384456A0F16B0570075F4C5 /* IntSizeCG.cpp in Sources */,
9384456B0F16B0570075F4C5 /* JoinTextNodesCommand.cpp in Sources */,
+ 93EF1C0E0F214F260070601B /* JPEGImageDecoder.cpp in Sources */,
9384456C0F16B0570075F4C5 /* KeyboardEvent.cpp in Sources */,
9384456D0F16B0570075F4C5 /* KeyframeAnimation.cpp in Sources */,
9384456E0F16B0570075F4C5 /* KeyframeList.cpp in Sources */,
+ 938444F00F16B0570075F4C5 /* KURLGoogle.cpp in Sources */,
9384456F0F16B0570075F4C5 /* Language.cpp in Sources */,
938445700F16B0570075F4C5 /* LayoutState.cpp in Sources */,
938445710F16B0570075F4C5 /* LegacyWebArchive.cpp in Sources */,
@@ -8972,8 +8979,8 @@
938445A20F16B0570075F4C5 /* NodeFilterCondition.cpp in Sources */,
938445A30F16B0570075F4C5 /* NodeIterator.cpp in Sources */,
938445A40F16B0570075F4C5 /* Notation.cpp in Sources */,
- B58DCCEE0F27DF1400BF697A /* OptionGroupElement.cpp in Sources */,
B58DCCEF0F27DF1400BF697A /* OptionElement.cpp in Sources */,
+ B58DCCEE0F27DF1400BF697A /* OptionGroupElement.cpp in Sources */,
938445A50F16B0570075F4C5 /* OriginQuotaManager.cpp in Sources */,
938445A60F16B0570075F4C5 /* OriginUsageRecord.cpp in Sources */,
938445A70F16B0570075F4C5 /* OverflowEvent.cpp in Sources */,
@@ -8997,11 +9004,13 @@
938445B90F16B0570075F4C5 /* PluginData.cpp in Sources */,
938445BA0F16B0570075F4C5 /* PluginDataChromium.cpp in Sources */,
938445BB0F16B0570075F4C5 /* PluginDocument.cpp in Sources */,
+ 93EF1C0F0F214F260070601B /* PNGImageDecoder.cpp in Sources */,
938445BD0F16B0570075F4C5 /* PointerEventsHitRules.cpp in Sources */,
938445BE0F16B0570075F4C5 /* PopupMenuChromium.cpp in Sources */,
938445BF0F16B0570075F4C5 /* Position.cpp in Sources */,
938445C00F16B0570075F4C5 /* PositionIterator.cpp in Sources */,
938445C10F16B0570075F4C5 /* PreloadScanner.cpp in Sources */,
+ 4DFEF7850F3B818C00F73D51 /* PrintContext.cpp in Sources */,
938445C20F16B0570075F4C5 /* ProcessingInstruction.cpp in Sources */,
938445C30F16B0570075F4C5 /* ProgressEvent.cpp in Sources */,
938445C40F16B0570075F4C5 /* ProgressTracker.cpp in Sources */,
@@ -9418,15 +9427,16 @@
938447610F16B0570075F4C5 /* WKSpecularLightingFilter.m in Sources */,
938447620F16B0570075F4C5 /* WKSpotLightFilter.m in Sources */,
938447630F16B0570075F4C5 /* WKTableTransferFilter.m in Sources */,
- 938447640F16B0570075F4C5 /* WorkerNavigator.cpp in Sources */,
- 5379C0CA0F2A841A0092C7DF /* WorkerThread.cpp in Sources */,
5379C0D70F2A845E0092C7DF /* Worker.cpp in Sources */,
5379C0D80F2A845E0092C7DF /* WorkerContext.cpp in Sources */,
5379C0D90F2A845E0092C7DF /* WorkerLocation.cpp in Sources */,
5379C0DA0F2A845E0092C7DF /* WorkerMessagingProxy.cpp in Sources */,
+ 938447640F16B0570075F4C5 /* WorkerNavigator.cpp in Sources */,
5379C0DB0F2A845E0092C7DF /* WorkerRunLoop.cpp in Sources */,
+ 5379C0CA0F2A841A0092C7DF /* WorkerThread.cpp in Sources */,
C8827AEFC4963CE96F4B2495 /* WorkerThreadableLoader.cpp in Sources */,
938447650F16B0570075F4C5 /* WrapContentsInDummySpanCommand.cpp in Sources */,
+ 93EF1C100F214F260070601B /* XBMImageDecoder.cpp in Sources */,
938447660F16B0570075F4C5 /* XMLHttpRequest.cpp in Sources */,
938447670F16B0570075F4C5 /* XMLHttpRequestUpload.cpp in Sources */,
938447680F16B0570075F4C5 /* XMLSerializer.cpp in Sources */,
@@ -9452,14 +9462,6 @@
9384477C0F16B0570075F4C5 /* XSLTExtensions.cpp in Sources */,
9384477D0F16B0570075F4C5 /* XSLTProcessor.cpp in Sources */,
9384477E0F16B0570075F4C5 /* XSLTUnicodeSort.cpp in Sources */,
- 93EF1C090F214F260070601B /* BMPImageDecoder.cpp in Sources */,
- 93EF1C0A0F214F260070601B /* BMPImageReader.cpp in Sources */,
- 93EF1C0B0F214F260070601B /* GIFImageDecoder.cpp in Sources */,
- 93EF1C0C0F214F260070601B /* GIFImageReader.cpp in Sources */,
- 93EF1C0D0F214F260070601B /* ICOImageDecoder.cpp in Sources */,
- 93EF1C0E0F214F260070601B /* JPEGImageDecoder.cpp in Sources */,
- 93EF1C0F0F214F260070601B /* PNGImageDecoder.cpp in Sources */,
- 93EF1C100F214F260070601B /* XBMImageDecoder.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};