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

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

Issue 8515017: Print Preview: Properly handle window.print(). (Closed)
Patch Set: Created 9 years, 1 month 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: 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 8122a66e27b904ab5e9d3d35e0996002922a58f9..7d55959f5ec83fa341523bf715cbc4ee53481f9d 100644
--- a/chrome/browser/ui/webui/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview_handler.cc
@@ -371,10 +371,10 @@ void PrintPreviewHandler::HandlePrint(const ListValue* args) {
regenerate_preview_request_count_);
TabContentsWrapper* initiator_tab = GetInitiatorTab();
- if (initiator_tab) {
- RenderViewHost* rvh = initiator_tab->render_view_host();
- rvh->Send(new PrintMsg_ResetScriptedPrintCount(rvh->routing_id()));
- }
+ CHECK(initiator_tab);
+
+ RenderViewHost* init_rvh = initiator_tab->render_view_host();
+ init_rvh->Send(new PrintMsg_ResetScriptedPrintCount(init_rvh->routing_id()));
scoped_ptr<DictionaryValue> settings(GetSettingsDictionary(args));
if (!settings.get())
@@ -428,6 +428,7 @@ void PrintPreviewHandler::HandlePrint(const ListValue* args) {
RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host();
rvh->Send(new PrintMsg_PrintForPrintPreview(rvh->routing_id(), *settings));
}
+ initiator_tab->print_view_manager()->PrintPreviewDone();
}
void PrintPreviewHandler::HandlePrintToPdf(

Powered by Google App Engine
This is Rietveld 408576698