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

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

Issue 23264035: Merge 218339 "Submitting https://codereview.chromium.org/2311600..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1599/src/
Patch Set: 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
===================================================================
--- chrome/browser/printing/print_view_manager_basic.cc (revision 218991)
+++ chrome/browser/printing/print_view_manager_basic.cc (working copy)
@@ -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() {
}
+#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);
+}
+
+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);
+}
+#endif
+
} // namespace printing
« no previous file with comments | « chrome/browser/printing/print_view_manager_basic.h ('k') | chrome/browser/printing/printing_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698