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

Unified Diff: chrome/renderer/print_web_view_helper.h

Issue 10168013: [Print Preview] Modified PrepareFrameAndViewPrint class to call the new printBegin function to supp… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/print_web_view_helper.h
diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
index 55a2e6be638d188e5fc8b1415c7fc76f5332be3a..9692cb146cde70f5448489496eea53024c7f55f3 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -18,6 +18,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintScalingOption.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h"
#include "ui/gfx/size.h"
@@ -62,17 +63,22 @@ class PrepareFrameAndViewForPrint {
void FinishPrinting();
private:
- void StartPrinting(const gfx::Size& print_params);
+ void StartPrinting(const gfx::Size& canvas_size,
+ const gfx::Rect& printable_area,
+ const gfx::Size& paper_size);
WebKit::WebFrame* frame_;
WebKit::WebNode node_to_print_;
WebKit::WebView* web_view_;
gfx::Size print_canvas_size_;
+ gfx::Rect printable_area_;
+ gfx::Size paper_size_;
gfx::Size prev_view_size_;
gfx::Size prev_scroll_offset_;
int dpi_;
int expected_pages_count_;
bool use_browser_overlays_;
+ WebKit::WebPrintScalingOption print_scaling_option_;
bool finished_;
DISALLOW_COPY_AND_ASSIGN(PrepareFrameAndViewForPrint);
@@ -200,7 +206,7 @@ class PrintWebViewHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.
- bool InitPrintSettings();
+ bool InitPrintSettings(bool fit_to_paper_size);
// Initialize print page settings with default settings and prepare the frame
// for print. A new PrepareFrameAndViewForPrint is created to fulfill the

Powered by Google App Engine
This is Rietveld 408576698