summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webkit_glue.cc
diff options
context:
space:
mode:
authorhamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 07:07:08 +0000
committerhamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 07:07:08 +0000
commit3e52d7d6df02b80809826c8a68b897d337ec8f94 (patch)
treeaeadfc9c0ed25885d74fbee47a4f5a3ca240e33a /webkit/glue/webkit_glue.cc
parented61511cb7e188b22e82648f1c166fe7904a4262 (diff)
downloadchromium_src-3e52d7d6df02b80809826c8a68b897d337ec8f94.zip
chromium_src-3e52d7d6df02b80809826c8a68b897d337ec8f94.tar.gz
chromium_src-3e52d7d6df02b80809826c8a68b897d337ec8f94.tar.bz2
Implement layoutTestController.numberOfPages.
BUG=35215 TEST=layout tests Review URL: http://codereview.chromium.org/594054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39199 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkit_glue.cc')
-rw-r--r--webkit/glue/webkit_glue.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc
index d5dee65..9e718a7 100644
--- a/webkit/glue/webkit_glue.cc
+++ b/webkit/glue/webkit_glue.cc
@@ -142,6 +142,15 @@ int PageNumberForElementById(WebFrame* web_frame,
page_height_in_pixels);
}
+int NumberOfPages(WebFrame* web_frame,
+ float page_width_in_pixels,
+ float page_height_in_pixels) {
+ WebSize size(page_width_in_pixels, page_height_in_pixels);
+ int number_of_pages = web_frame->printBegin(size);
+ web_frame->printEnd();
+ return number_of_pages;
+}
+
std::wstring DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) {
gfx::Size offset = web_frame->scrollOffset();
std::wstring result;