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

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

Issue 410473002: Assertion removed in print_preview_pdf_generated.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed |end_loop_callback_|. Observer didn't need it as a member variable. Created 6 years, 5 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
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 86ee312de2523d6cdec431d45fdeac0d8f56af72..18fb280fd917dd8baaa0ce8018824e0780ab05db 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -278,11 +278,13 @@ void ReportPrintSettingsStats(const base::DictionaryValue& settings) {
// Callback that stores a PDF file on disk.
void PrintToPdfCallback(printing::Metafile* metafile,
- const base::FilePath& path) {
+ const base::FilePath& path,
+ const base::Closure& pdf_file_saved_callback) {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
metafile->SaveTo(path);
// |metafile| must be deleted on the UI thread.
BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, metafile);
+ pdf_file_saved_callback.Run();
Lei Zhang 2014/07/22 03:04:39 What happens when you save to PDF outside of your
ivandavid 2014/07/22 19:02:01 Done.
}
std::string GetDefaultPrinterOnFileThread() {
@@ -1372,7 +1374,10 @@ void PrintPreviewHandler::PostPrintToPdfTask() {
metafile->InitFromData(static_cast<const void*>(data->front()), data->size());
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- base::Bind(&PrintToPdfCallback, metafile.release(), print_to_pdf_path_));
+ base::Bind(&PrintToPdfCallback,
+ metafile.release(),
+ print_to_pdf_path_,
+ pdf_file_saved_callback_));
print_to_pdf_path_ = base::FilePath();
ClosePreviewDialog();
}
@@ -1631,3 +1636,8 @@ void PrintPreviewHandler::UnregisterForMergeSession() {
if (reconcilor_)
reconcilor_->RemoveMergeSessionObserver(this);
}
+
+void PrintPreviewHandler::SetPdfSavedCallbackForTesting(
+ const base::Closure& callback) {
+ pdf_file_saved_callback_ = callback;
+}

Powered by Google App Engine
This is Rietveld 408576698