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

Unified Diff: chrome/browser/printing/print_view_manager.cc

Issue 9703013: Printing: Catch more error conditions and remove more cruft. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | « no previous file | chrome/renderer/print_web_view_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_view_manager.cc
===================================================================
--- chrome/browser/printing/print_view_manager.cc (revision 126455)
+++ chrome/browser/printing/print_view_manager.cc (working copy)
@@ -135,8 +135,7 @@
void PrintViewManager::PreviewPrintingRequestCancelled() {
if (!web_contents())
return;
- RenderViewHost* rvh = web_contents()->GetRenderViewHost();
- rvh->Send(new PrintMsg_PreviewPrintingRequestCancelled(rvh->GetRoutingID()));
+ Send(new PrintMsg_PreviewPrintingRequestCancelled(routing_id()));
}
void PrintViewManager::set_observer(PrintViewManagerObserver* observer) {
@@ -486,10 +485,9 @@
}
void PrintViewManager::PrintingDone(bool success) {
- if (!print_job_.get() || !web_contents())
+ if (!print_job_.get())
return;
- RenderViewHost* rvh = web_contents()->GetRenderViewHost();
- rvh->Send(new PrintMsg_PrintingDone(rvh->GetRoutingID(), success));
+ Send(new PrintMsg_PrintingDone(routing_id(), success));
}
void PrintViewManager::TerminatePrintJob(bool cancel) {
@@ -593,8 +591,10 @@
bool PrintViewManager::PrintNowInternal(IPC::Message* message) {
// Don't print / print preview interstitials.
- if (web_contents()->ShowingInterstitialPage())
+ if (web_contents()->ShowingInterstitialPage()) {
+ delete message;
return false;
+ }
return Send(message);
}
« no previous file with comments | « no previous file | chrome/renderer/print_web_view_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698