Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: webkit/glue/webkit_glue.cc

Issue 594054: Implement layoutTestController.numberOfPages. (Closed)
Patch Set: update per yuzo's suggestion Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/glue/webkit_glue.h ('k') | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/glue/webkit_glue.h" 5 #include "webkit/glue/webkit_glue.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <objidl.h> 8 #include <objidl.h>
9 #include <mlang.h> 9 #include <mlang.h>
10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX)
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 int PageNumberForElementById(WebFrame* web_frame, 136 int PageNumberForElementById(WebFrame* web_frame,
137 const std::string& id, 137 const std::string& id,
138 float page_width_in_pixels, 138 float page_width_in_pixels,
139 float page_height_in_pixels) { 139 float page_height_in_pixels) {
140 return web_frame->pageNumberForElementById(WebString::fromUTF8(id), 140 return web_frame->pageNumberForElementById(WebString::fromUTF8(id),
141 page_width_in_pixels, 141 page_width_in_pixels,
142 page_height_in_pixels); 142 page_height_in_pixels);
143 } 143 }
144 144
145 int NumberOfPages(WebFrame* web_frame,
146 float page_width_in_pixels,
147 float page_height_in_pixels) {
148 WebSize size(page_width_in_pixels, page_height_in_pixels);
149 int number_of_pages = web_frame->printBegin(size);
150 web_frame->printEnd();
151 return number_of_pages;
152 }
153
145 std::wstring DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { 154 std::wstring DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) {
146 gfx::Size offset = web_frame->scrollOffset(); 155 gfx::Size offset = web_frame->scrollOffset();
147 std::wstring result; 156 std::wstring result;
148 157
149 if (offset.width() > 0 || offset.height() > 0) { 158 if (offset.width() > 0 || offset.height() > 0) {
150 if (web_frame->parent()) { 159 if (web_frame->parent()) {
151 StringAppendF(&result, L"frame '%ls' ", UTF16ToWide( 160 StringAppendF(&result, L"frame '%ls' ", UTF16ToWide(
152 web_frame->name()).c_str()); 161 web_frame->name()).c_str());
153 } 162 }
154 StringAppendF(&result, L"scrolled to %d,%d\n", 163 StringAppendF(&result, L"scrolled to %d,%d\n",
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 526
518 bool IsMediaCacheEnabled() { 527 bool IsMediaCacheEnabled() {
519 return g_enable_media_cache; 528 return g_enable_media_cache;
520 } 529 }
521 530
522 void SetMediaCacheEnabled(bool enabled) { 531 void SetMediaCacheEnabled(bool enabled) {
523 g_enable_media_cache = enabled; 532 g_enable_media_cache = enabled;
524 } 533 }
525 534
526 } // namespace webkit_glue 535 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webkit_glue.h ('k') | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698