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

Unified Diff: chrome/renderer/print_web_view_helper.h

Issue 8585017: PrintPreview: Honor the print media page size and margin values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 1 month 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 66a306f53e4290d0374938e50b063aebc749d506..ed9057ac3279b5541ba89675fa782a9596b9eccc 100644
--- a/chrome/renderer/print_web_view_helper.h
+++ b/chrome/renderer/print_web_view_helper.h
@@ -117,6 +117,9 @@ class PrintWebViewHelper
// Print the document with the print preview frame/node.
void OnPrintForSystemDialog();
+ // Update |default_margins_requested_| based on settings.
+ void UpdateDefaultMarginsRequested(const base::DictionaryValue& settings);
+
// Initiate print preview.
void OnInitiatePrintPreview();
@@ -243,13 +246,15 @@ class PrintWebViewHelper
WebKit::WebFrame* frame,
int page_index,
const PrintMsg_Print_Params& default_params,
- printing::PageSizeMargins* page_layout_in_points);
+ printing::PageSizeMargins* page_layout_in_points,
+ bool default_margins_requested);
static void UpdatePrintableSizeInPrintParameters(
WebKit::WebFrame* frame,
const WebKit::WebNode& node,
PrepareFrameAndViewForPrint* prepare,
- PrintMsg_Print_Params* params);
+ PrintMsg_Print_Params* params,
+ bool default_margins_requested);
vandebo (ex-Chrome) 2011/11/17 23:05:23 No need to pass this down, just access the member
kmadhusu 2011/12/01 02:15:42 This is a static function.
kmadhusu 2011/12/01 02:15:42 (as we discussed) I am ignoring this comment.
// Given the |device| and |canvas| to draw on, prints the appropriate headers
// and footers using strings from |header_footer_info| on to the canvas.
@@ -300,6 +305,7 @@ class PrintWebViewHelper
scoped_ptr<PrintMsg_PrintPages_Params> print_pages_params_;
bool is_preview_enabled_;
bool is_print_ready_metafile_sent_;
+ bool default_margins_requested_;
vandebo (ex-Chrome) 2011/11/17 23:05:23 Should this go in PrintPreviewContext since it's o
kmadhusu 2011/12/01 02:15:42 (as we discussed) I am ignoring this comment.
// Used for scripted initiated printing blocking.
base::Time last_cancelled_script_print_;
@@ -344,7 +350,8 @@ class PrintWebViewHelper
// Create the print preview document. |pages| is empty to print all pages.
bool CreatePreviewDocument(PrintMsg_Print_Params* params,
- const std::vector<int>& pages);
+ const std::vector<int>& pages,
+ bool default_margins_requested);
vandebo (ex-Chrome) 2011/11/17 23:05:23 No need to pass this down, just access the member
kmadhusu 2011/12/01 02:15:42 (as we discussed) I am ignoring this comment.
// Called after a page gets rendered. |page_time| is how long the
// rendering took.

Powered by Google App Engine
This is Rietveld 408576698