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

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

Issue 7993005: Reuse PrintContext to excessively triggering matchMedia('print') listeners. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Adds a unit test and updates DPI on change. Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return web_frame->pageNumberForElementById(WebString::fromUTF8(id), 147 return web_frame->pageNumberForElementById(WebString::fromUTF8(id),
148 page_width_in_pixels, 148 page_width_in_pixels,
149 page_height_in_pixels); 149 page_height_in_pixels);
150 } 150 }
151 151
152 int NumberOfPages(WebFrame* web_frame, 152 int NumberOfPages(WebFrame* web_frame,
153 float page_width_in_pixels, 153 float page_width_in_pixels,
154 float page_height_in_pixels) { 154 float page_height_in_pixels) {
155 WebSize size(static_cast<int>(page_width_in_pixels), 155 WebSize size(static_cast<int>(page_width_in_pixels),
156 static_cast<int>(page_height_in_pixels)); 156 static_cast<int>(page_height_in_pixels));
157 int number_of_pages = web_frame->printBegin(size); 157 web_frame->printBegin();
158 int number_of_pages = web_frame->setPageSizeResolution(size);
158 web_frame->printEnd(); 159 web_frame->printEnd();
159 return number_of_pages; 160 return number_of_pages;
160 } 161 }
161 162
162 string16 DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { 163 string16 DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) {
163 gfx::Size offset = web_frame->scrollOffset(); 164 gfx::Size offset = web_frame->scrollOffset();
164 std::string result_utf8; 165 std::string result_utf8;
165 166
166 if (offset.width() > 0 || offset.height() > 0) { 167 if (offset.width() > 0 || offset.height() > 0) {
167 if (web_frame->parent()) { 168 if (web_frame->parent()) {
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 NOTIMPLEMENTED(); 439 NOTIMPLEMENTED();
439 return NULL; 440 return NULL;
440 #endif 441 #endif
441 } 442 }
442 443
443 int GetGlyphPageCount() { 444 int GetGlyphPageCount() {
444 return WebGlyphCache::pageCount(); 445 return WebGlyphCache::pageCount();
445 } 446 }
446 447
447 } // namespace webkit_glue 448 } // namespace webkit_glue
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698