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 e1455bd020df077375eba0be09c5bcb1f20c1a89..220126a28812510eaa087b9d6f0e3d6877b88107 100644 |
--- a/chrome/browser/ui/webui/print_preview_handler.cc |
+++ b/chrome/browser/ui/webui/print_preview_handler.cc |
@@ -483,9 +483,33 @@ void PrintPreviewHandler::HandleGetPreview(const ListValue* args) { |
print_preview_ui->OnPrintPreviewFailed(); |
return; |
} |
+ |
+ bool displayHeaderFooter; |
dpapad
2011/07/19 20:34:01
Rename to display_header_footer, see styleguide fo
Aayush Kumar
2011/07/21 21:58:53
Done.
|
+ if (!settings->GetBoolean(printing::kSettingHeaderFooter, |
+ &displayHeaderFooter)) { |
+ NOTREACHED(); |
+ } |
+ |
+ // If headers and footers option is checked then we retrieve the page title |
+ // and url and send it to the renderer process. |
dpapad
2011/07/19 20:34:01
Nit: Change to "If headers and footers option is c
Aayush Kumar
2011/07/21 21:58:53
Done.
|
+ DictionaryValue header_footer_info; |
+ if (displayHeaderFooter) { |
+ header_footer_info.SetString(printing::kSettingHeaderFooterTitle, |
+ initiator_tab->GetTitle()); |
+ |
+ std::string footer_url; |
+ NavigationEntry* entry = initiator_tab->controller().GetActiveEntry(); |
+ if (entry) |
+ footer_url = entry->virtual_url().spec(); |
+ |
+ header_footer_info.SetString(printing::kSettingHeaderFooterURL, |
+ footer_url); |
+ } |
+ |
VLOG(1) << "Print preview request start"; |
RenderViewHost* rvh = initiator_tab->render_view_host(); |
- rvh->Send(new PrintMsg_PrintPreview(rvh->routing_id(), *settings)); |
+ rvh->Send(new PrintMsg_PrintPreview(rvh->routing_id(), *settings, |
+ header_footer_info)); |
} |
void PrintPreviewHandler::HandlePrint(const ListValue* args) { |