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

Unified Diff: printing/printing_context.cc

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.cc
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
index fb554e77f9175b27780642879c8a70b9b6f3cbd4..a9f2a15729c97ab2f62e7970bb8e16e554006769 100644
--- a/printing/printing_context.cc
+++ b/printing/printing_context.cc
@@ -4,7 +4,9 @@
#include "printing/printing_context.h"
+#include "base/logging.h"
#include "base/values.h"
+#include "printing/print_job_constants.h"
namespace printing {
@@ -33,4 +35,26 @@ PrintingContext::Result PrintingContext::OnError() {
return abort_printing_ ? CANCEL : FAILED;
}
+void PrintingContext::GetHeaderFooterInfo(
+ const base::DictionaryValue& settings,
+ base::DictionaryValue* header_footer_info) {
+ bool display_header_footer;
+ if (!settings.GetBoolean(printing::kSettingHeaderFooterEnabled,
+ &display_header_footer)) {
+ NOTREACHED();
+ }
+ header_footer_info->SetBoolean(printing::kSettingHeaderFooterEnabled,
+ display_header_footer);
+ if (display_header_footer) {
+ string16 title;
+ std::string url;
+ if (!settings.GetString(printing::kSettingHeaderFooterTitle, &title) ||
+ !settings.GetString(printing::kSettingHeaderFooterURL, &url)) {
+ NOTREACHED();
+ }
+ header_footer_info->SetString(printing::kSettingHeaderFooterURL, url);
+ header_footer_info->SetString(printing::kSettingHeaderFooterTitle, title);
+ }
+}
+
} // namespace printing

Powered by Google App Engine
This is Rietveld 408576698