cef/patch/patches/webkit_glue.patch

50 lines
1.7 KiB
Diff

Index: webframe.h
===================================================================
--- webframe.h (revision 21529)
+++ webframe.h (working copy)
@@ -404,6 +404,11 @@
// size.
virtual int PrintBegin(const WebKit::WebSize& page_size) = 0;
+ // Returns the page shrinking factor calculated by webkit (usually between
+ // 1/1.25 and 1/2). Returns 0 if the page number is invalid or not in printing
+ // mode.
+ virtual float GetPrintPageShrink(int page) = 0;
+
// Prints one page, and returns the calculated page shrinking factor (usually
// between 1/1.25 and 1/2). Returns 0 if the page number is invalid or not
// in printing mode.
Index: webframe_impl.cc
===================================================================
--- webframe_impl.cc (revision 21529)
+++ webframe_impl.cc (working copy)
@@ -1766,6 +1766,16 @@
return print_context_->pageCount();
}
+float WebFrameImpl::GetPrintPageShrink(int page) {
+ // Ensure correct state.
+ if (!print_context_.get() || page < 0) {
+ NOTREACHED();
+ return 0;
+ }
+
+ return print_context_->getPageShrink(page);
+}
+
float WebFrameImpl::PrintPage(int page, WebCanvas* canvas) {
// Ensure correct state.
if (!print_context_.get() || page < 0 || !frame() || !frame()->document()) {
Index: webframe_impl.h
===================================================================
--- webframe_impl.h (revision 21529)
+++ webframe_impl.h (working copy)
@@ -195,6 +195,7 @@
virtual WebKit::WebSize ScrollOffset() const;
virtual int PrintBegin(const WebKit::WebSize& page_size);
+ virtual float GetPrintPageShrink(int page);
virtual float PrintPage(int page, WebKit::WebCanvas* canvas);
virtual void PrintEnd();