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

Unified Diff: printing/printing_context_mac.mm

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Changes based on Kausalya's comments 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_mac.mm
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
index 90654e20ad228a86f845b81480e1b99dfe0bede0..7783569e2e079a752924801fe0bb6725c457ce00 100644
--- a/printing/printing_context_mac.mm
+++ b/printing/printing_context_mac.mm
@@ -82,7 +82,11 @@ void PrintingContextMac::AskUserForSettings(gfx::NativeView parent_view,
NSInteger selection = [panel runModalWithPrintInfo:printInfo];
if (selection == NSOKButton) {
print_info_.reset([[panel printInfo] retain]);
- InitPrintSettingsFromPrintInfo(GetPageRangesFromPrintInfo());
+ DictionaryValue header_footer_info;
+ header_footer_info.SetBoolean(printing::kSettingHeaderFooterEnabled,
+ false);
+ InitPrintSettingsFromPrintInfo(GetPageRangesFromPrintInfo(),
+ header_footer_info);
callback->Run(OK);
} else {
callback->Run(CANCEL);
@@ -93,7 +97,11 @@ PrintingContext::Result PrintingContextMac::UseDefaultSettings() {
DCHECK(!in_print_job_);
print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]);
- InitPrintSettingsFromPrintInfo(GetPageRangesFromPrintInfo());
+ DictionaryValue header_footer_info;
+ header_footer_info.SetBoolean(printing::kSettingHeaderFooterEnabled,
kmadhusu 2011/08/12 20:27:11 nit: If possible, have a function that populates t
Aayush Kumar 2011/08/13 04:04:53 Done.
+ false);
+ InitPrintSettingsFromPrintInfo(GetPageRangesFromPrintInfo(),
+ header_footer_info);
return OK;
}
@@ -150,12 +158,16 @@ PrintingContext::Result PrintingContextMac::UpdatePrintSettings(
[print_info_.get() updateFromPMPrintSettings];
- InitPrintSettingsFromPrintInfo(ranges);
+ DictionaryValue header_footer_info;
+ GetHeaderFooterInfo(job_settings, &header_footer_info);
+
+ InitPrintSettingsFromPrintInfo(ranges, header_footer_info);
return OK;
}
void PrintingContextMac::InitPrintSettingsFromPrintInfo(
- const PageRanges& ranges) {
+ const PageRanges& ranges,
+ const DictionaryValue& header_footer_info) {
PMPrintSession print_session =
static_cast<PMPrintSession>([print_info_.get() PMPrintSession]);
PMPageFormat page_format =

Powered by Google App Engine
This is Rietveld 408576698