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

Unified Diff: printing/printing_context_win.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Moved elide text to print_settings_initializer Created 9 years, 4 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: printing/printing_context_win.cc
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
index 17e589067b502c7d15e6e0780a327f34ce8d6924..6a5918beaabb59d12408e2bf5763c8185dd57cc6 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -394,9 +394,31 @@ PrintingContext::Result PrintingContextWin::UpdatePrintSettings(
ClosePrinter(printer);
return OnError();
}
+
+ bool display_header_footer;
kmadhusu 2011/08/12 17:07:00 Move this common code to a helper function in prin
Aayush Kumar 2011/08/12 18:53:42 Done.
+ // Getting Header and Footer settings.
+ if (!job_settings.GetBoolean(printing::kSettingHeaderFooterEnabled,
+ &display_header_footer)) {
+ NOTREACHED();
+ }
+ DictionaryValue header_footer_info;
+ header_footer_info.SetBoolean(printing::kSettingHeaderFooterEnabled,
+ display_header_footer);
+ if (display_header_footer) {
+ string16 title;
+ std::string url;
+ if (!job_settings.GetString(printing::kSettingHeaderFooterTitle, &title) ||
+ !job_settings.GetString(printing::kSettingHeaderFooterURL, &url)) {
+ NOTREACHED();
+ }
+ header_footer_info.SetString(printing::kSettingHeaderFooterURL, url);
+ header_footer_info.SetString(printing::kSettingHeaderFooterTitle, title);
+ }
+
PrintSettingsInitializerWin::InitPrintSettings(context_, *dev_mode,
ranges, device_name,
- false, &settings_);
+ false, header_footer_info,
+ &settings_);
ClosePrinter(printer);
return OK;
}
@@ -583,11 +605,15 @@ bool PrintingContextWin::InitializeSettings(const DEVMODE& dev_mode,
}
}
+ DictionaryValue header_footer_info;
+ header_footer_info.SetBoolean(printing::kSettingHeaderFooterEnabled,
+ false);
PrintSettingsInitializerWin::InitPrintSettings(context_,
dev_mode,
ranges_vector,
new_device_name,
selection_only,
+ header_footer_info,
&settings_);
return true;

Powered by Google App Engine
This is Rietveld 408576698