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

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

Issue 740983002: Implement window.print() on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle printing disabled or not supported Created 6 years, 1 month 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
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
index 6af14f7f13139f166d1dea644f004294a9b5dcdd..1c633cbebbcfcec768f5abbe0d5ea4a42e55afd4 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,17 @@ void PrintingMessageFilter::OnScriptedPrint(
printer_query =
queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id());
}
+
+ DLOG(INFO) << "DGN OnScriptedPrint - cookie: " << params.cookie;
+
+ GetSettingsAskParam ask_param;
+ if (params.use_system_specific_flow) { // Android only path
+ ask_param = GetSettingsAskParam::SYSTEM_SPECIFIC;
+ } else {
+ ask_param = GetSettingsAskParam::ASK_USER;
+ }
printer_query->GetSettings(
- PrinterQuery::ASK_USER,
+ ask_param,
params.expected_pages_count,
params.has_selection,
params.margin_type,
@@ -338,6 +348,9 @@ 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.
@@ -373,6 +386,9 @@ void PrintingMessageFilter::OnScriptedPrintReply(
#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;

Powered by Google App Engine
This is Rietveld 408576698