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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added Headers and Footers support - New Snapshot Uploaded Created 9 years, 5 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.cc
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index a918de76ccc2cec1ba6b39ee0dae32ce91cbd898..03fe4d7f48fea12b266185a29fab85b078c79d41 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -84,6 +84,8 @@ bool PrintMsg_Print_Params_IsEqual(
oldParams.params.supports_alpha_blend ==
newParams.params.supports_alpha_blend &&
oldParams.pages.size() == newParams.pages.size() &&
+ oldParams.params.header_footer ==
+ newParams.params.header_footer &&
std::equal(oldParams.pages.begin(), oldParams.pages.end(),
newParams.pages.begin());
}
@@ -154,7 +156,8 @@ PrintWebViewHelper::PrintWebViewHelper(RenderView* render_view)
context_menu_preview_node_(NULL),
user_cancelled_scripted_print_count_(0),
notify_browser_of_print_failure_(true),
- preview_page_count_(0) {
+ preview_page_count_(0),
+ header_footer_interstice(7.2) {
Lei Zhang 2011/07/12 22:04:50 where does this magical 7.2 value come from?
Aayush Kumar 2011/07/13 21:52:16 Moved declaration of constant to job_constants. On
is_preview_ = switches::IsPrintPreviewEnabled();
}
@@ -262,10 +265,13 @@ void PrintWebViewHelper::OnPrintPages() {
Print(frame, NULL);
}
-void PrintWebViewHelper::OnPrintPreview(const DictionaryValue& settings) {
+void PrintWebViewHelper::OnPrintPreview(const DictionaryValue& settings,
+ const DictionaryValue& header_footer_info) {
DCHECK(is_preview_);
DCHECK(!context_menu_preview_node_.get() || !script_initiated_preview_frame_);
+ header_footer_info_ = header_footer_info.DeepCopy();
+
if (script_initiated_preview_frame_) {
// Script initiated print preview.
PrintPreview(script_initiated_preview_frame_, NULL, settings);

Powered by Google App Engine
This is Rietveld 408576698