Index: chrome/browser/printing/printing_message_filter.cc |
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc |
index 6af14f7f13139f166d1dea644f004294a9b5dcdd..d6f555824510363caf1b2cc6cf90727f2bf6eb3b 100644 |
--- a/chrome/browser/printing/printing_message_filter.cc |
+++ b/chrome/browser/printing/printing_message_filter.cc |
@@ -34,6 +34,7 @@ |
#if defined(OS_ANDROID) |
#include "base/strings/string_number_conversions.h" |
+#include "chrome/browser/android/tab_android.h" |
#include "chrome/browser/printing/print_view_manager_basic.h" |
#include "printing/printing_context_android.h" |
#endif |
@@ -280,7 +281,7 @@ void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) { |
// Loads default settings. This is asynchronous, only the IPC message sender |
// will hang until the settings are retrieved. |
printer_query->GetSettings( |
- PrinterQuery::DEFAULTS, |
+ GetSettingsAskParam::DEFAULTS, |
0, |
false, |
DEFAULT_MARGINS, |
@@ -323,8 +324,22 @@ void PrintingMessageFilter::OnScriptedPrint( |
printer_query = |
queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id()); |
} |
- printer_query->GetSettings( |
- PrinterQuery::ASK_USER, |
+ |
+ DLOG(INFO) << "DGN OnScriptedPrint - cookie: " << params.cookie; |
+ |
+ if (params.use_system_specific_flow) { |
+ printer_query->GetSettings( |
+ GetSettingsAskParam::SYSTEM_SPECIFIC, |
+ params.expected_pages_count, |
+ params.has_selection, |
+ params.margin_type, |
+ base::Bind(&PrintingMessageFilter::OnSystemSpecificReply, |
+ this, |
+ printer_query, |
+ reply_msg)); |
+ } else { |
+ printer_query->GetSettings( |
+ GetSettingsAskParam::ASK_USER, |
params.expected_pages_count, |
params.has_selection, |
params.margin_type, |
@@ -332,12 +347,16 @@ void PrintingMessageFilter::OnScriptedPrint( |
this, |
printer_query, |
reply_msg)); |
+ } |
} |
void PrintingMessageFilter::OnScriptedPrintReply( |
scoped_refptr<PrinterQuery> printer_query, |
IPC::Message* reply_msg) { |
PrintMsg_PrintPages_Params params; |
+ |
+DLOG(INFO) << "DGN OnScriptedPrintReply"; |
+ |
#if defined(OS_ANDROID) |
// We need to save the routing ID here because Send method below deletes the |
// |reply_msg| before we can get the routing ID for the Android code. |
@@ -370,9 +389,21 @@ void PrintingMessageFilter::OnScriptedPrintReply( |
} |
} |
+void PrintingMessageFilter::OnSystemSpecificReply( |
+ scoped_refptr<PrinterQuery> printer_query, |
+ IPC::Message* reply_msg) { |
+ |
+ DLOG(INFO) << "DGN OnSystemSpecificReply"; |
+ Send(reply_msg); |
+ printer_query->StopWorker(); |
+} |
+ |
#if defined(OS_ANDROID) |
void PrintingMessageFilter::UpdateFileDescriptor(int render_view_id, int fd) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ |
+ DLOG(INFO) << "DGN UpdateFileDescriptor"; |
+ |
content::WebContents* wc = GetWebContentsForRenderView(render_view_id); |
if (!wc) |
return; |