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

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

Issue 23116003: Adds PrintingContext implementation stub for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes some build targets and try bots. Some other nits. Created 7 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/print_view_manager_basic.cc
diff --git a/chrome/browser/printing/print_view_manager_basic.cc b/chrome/browser/printing/print_view_manager_basic.cc
index 6f524d173596597191f26eaa8292b86f3c3dee6f..d978999a07105e7ca3335be71192570f25826782 100644
--- a/chrome/browser/printing/print_view_manager_basic.cc
+++ b/chrome/browser/printing/print_view_manager_basic.cc
@@ -1,9 +1,15 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/printing/print_view_manager_basic.h"
+#if defined(OS_ANDROID)
+#include "base/file_descriptor_posix.h"
+#include "chrome/common/print_messages.h"
+#include "printing/printing_context_android.h"
+#endif
+
DEFINE_WEB_CONTENTS_USER_DATA_KEY(printing::PrintViewManagerBasic);
namespace printing {
@@ -15,4 +21,28 @@ PrintViewManagerBasic::PrintViewManagerBasic(content::WebContents* web_contents)
PrintViewManagerBasic::~PrintViewManagerBasic() {
}
+#if defined(OS_ANDROID)
+void PrintViewManagerBasic::RenderProcessGone(base::TerminationStatus status) {
+ PrintingContextAndroid::PdfWritingDone(file_descriptor_.fd, false);
+ file_descriptor_ = base::FileDescriptor(-1, false);
+ PrintViewManagerBase::RenderProcessGone(status);
Vitaly Buka (NO REVIEWS) 2013/08/19 16:14:19 class PrintViewManagerAndroid : public PrintViewMa
+}
+
+void PrintViewManagerBasic::OnPrintingFailed(int cookie) {
+ PrintingContextAndroid::PdfWritingDone(file_descriptor_.fd, false);
+ file_descriptor_ = base::FileDescriptor(-1, false);
+ PrintViewManagerBase::OnPrintingFailed(cookie);
+}
+
+bool PrintViewManagerBasic::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(PrintViewManagerBasic, message)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_PrintingFailed, OnPrintingFailed)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+
+ return handled ? true : PrintViewManagerBase::OnMessageReceived(message);
Vitaly Buka (NO REVIEWS) 2013/08/19 16:14:19 return handled || PrintViewManagerBase::OnMessageR
+}
+#endif
+
} // namespace printing

Powered by Google App Engine
This is Rietveld 408576698