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

Unified Diff: chrome/browser/ui/webui/print_preview_handler.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove header_footer_info from settings Dictionary. Changes as per Steve and Kausalya's comments. 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
« no previous file with comments | « chrome/browser/ui/webui/print_preview_data_source.cc ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc
index 22be5a7b5703d9d1c1386aff734205536e984952..2d061e7284ea4abf4d443c68ad1a0412596672ef 100644
--- a/chrome/browser/ui/webui/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview_handler.cc
@@ -489,6 +489,24 @@ void PrintPreviewHandler::HandleGetPreview(const ListValue* args) {
print_preview_ui->OnPrintPreviewFailed();
return;
}
+
+ // Retrieve the page title and url and send it to the renderer process if
+ // headers and footers are to be displayed.
+ bool display_header_footer;
Lei Zhang 2011/08/03 01:28:31 If you don't initialize |display_header_footer|, y
Aayush Kumar 2011/08/03 15:52:54 Done.
+ if (!settings->GetBoolean(printing::kSettingHeaderFooter,
+ &display_header_footer)) {
+ NOTREACHED();
+ }
+ if (display_header_footer) {
+ settings->SetString(printing::kSettingHeaderFooterTitle,
+ initiator_tab->GetTitle());
+ std::string url;
+ NavigationEntry* entry = initiator_tab->controller().GetActiveEntry();
+ if (entry)
+ url = entry->virtual_url().spec();
+ settings->SetString(printing::kSettingHeaderFooterURL, url);
+ }
+
VLOG(1) << "Print preview request start";
RenderViewHost* rvh = initiator_tab->render_view_host();
rvh->Send(new PrintMsg_PrintPreview(rvh->routing_id(), *settings));
« no previous file with comments | « chrome/browser/ui/webui/print_preview_data_source.cc ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698