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

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

Issue 7621087: Print Preview: Go from event driven print preview back to print preview with sync messages. The s... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove requested_page Created 9 years, 4 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/printing/printing_message_filter.cc
===================================================================
--- chrome/browser/printing/printing_message_filter.cc (revision 97484)
+++ chrome/browser/printing/printing_message_filter.cc (working copy)
@@ -4,16 +4,20 @@
#include "chrome/browser/printing/printing_message_filter.h"
+#include <string>
+
#include "base/process_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/printing/print_job_manager.h"
+#include "chrome/browser/ui/webui/print_preview_ui.h"
#include "chrome/common/print_messages.h"
-#include "content/common/view_messages.h"
#if defined(OS_CHROMEOS)
#include <fcntl.h>
+#include <map>
+
#include "base/file_util.h"
#include "base/lazy_instance.h"
#include "chrome/browser/printing/print_dialog_cloud.h"
@@ -108,6 +112,7 @@
IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_ScriptedPrint, OnScriptedPrint)
IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_UpdatePrintSettings,
OnUpdatePrintSettings)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_CheckForCancel, OnCheckForCancel)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -312,3 +317,16 @@
else
printer_query->StopWorker();
}
+
+void PrintingMessageFilter::OnCheckForCancel(const std::string& preview_ui_addr,
+ int preview_request_id,
+ bool* cancel) {
+ if (PrintPreviewUI::GetCurrentPrintPreviewStatus(preview_ui_addr,
+ preview_request_id,
+ cancel)) {
+ return;
+ }
+ // If we cannot get the status for |preview_ui_addr|, then the print preview
+ // tab is gone, and thus the initiator tab should cancel.
+ *cancel = true;
+}

Powered by Google App Engine
This is Rietveld 408576698