| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/printing/print_view_manager.h" | 5 #include "chrome/browser/printing/print_view_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 void PrintViewManager::RenderViewGone(base::TerminationStatus status) { | 187 void PrintViewManager::RenderViewGone(base::TerminationStatus status) { |
| 188 print_preview_state_ = NOT_PREVIEWING; | 188 print_preview_state_ = NOT_PREVIEWING; |
| 189 ReleasePrinterQuery(); | 189 ReleasePrinterQuery(); |
| 190 | 190 |
| 191 if (!print_job_.get()) | 191 if (!print_job_.get()) |
| 192 return; | 192 return; |
| 193 | 193 |
| 194 scoped_refptr<PrintedDocument> document(print_job_->document()); | 194 scoped_refptr<PrintedDocument> document(print_job_->document()); |
| 195 if (document) { | 195 if (document.get()) { |
| 196 // If IsComplete() returns false, the document isn't completely rendered. | 196 // If IsComplete() returns false, the document isn't completely rendered. |
| 197 // Since our renderer is gone, there's nothing to do, cancel it. Otherwise, | 197 // Since our renderer is gone, there's nothing to do, cancel it. Otherwise, |
| 198 // the print job may finish without problem. | 198 // the print job may finish without problem. |
| 199 TerminatePrintJob(!document->IsComplete()); | 199 TerminatePrintJob(!document->IsComplete()); |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 string16 PrintViewManager::RenderSourceName() { | 203 string16 PrintViewManager::RenderSourceName() { |
| 204 string16 name(web_contents()->GetTitle()); | 204 string16 name(web_contents()->GetTitle()); |
| 205 if (name.empty()) | 205 if (name.empty()) |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 scoped_refptr<printing::PrinterQuery> printer_query; | 676 scoped_refptr<printing::PrinterQuery> printer_query; |
| 677 print_job_manager->PopPrinterQuery(cookie, &printer_query); | 677 print_job_manager->PopPrinterQuery(cookie, &printer_query); |
| 678 if (!printer_query.get()) | 678 if (!printer_query.get()) |
| 679 return; | 679 return; |
| 680 BrowserThread::PostTask( | 680 BrowserThread::PostTask( |
| 681 BrowserThread::IO, FROM_HERE, | 681 BrowserThread::IO, FROM_HERE, |
| 682 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 682 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
| 683 } | 683 } |
| 684 | 684 |
| 685 } // namespace printing | 685 } // namespace printing |
| OLD | NEW |