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

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

Issue 8515017: Print Preview: Properly handle window.print(). (Closed)
Patch Set: fail instead of crash when 2 views both do window.print() 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 0f04e4afa16e0b2e3c553526d70af249bb4746a6..e4d63422117980570421f8701cea5db7f275371b 100644
--- a/chrome/browser/ui/webui/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview_handler.cc
@@ -368,10 +368,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())
@@ -439,6 +439,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(
« no previous file with comments | « chrome/browser/printing/printing_message_filter.cc ('k') | chrome/browser/ui/webui/print_preview_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698