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

Unified Diff: android_webview/browser/aw_printing_message_filter.h

Issue 854513002: Remove the discrepencies between chrome and android_webview print (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address code review Created 5 years, 11 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: android_webview/browser/aw_printing_message_filter.h
diff --git a/android_webview/browser/aw_printing_message_filter.h b/android_webview/browser/aw_printing_message_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..dac654804d68b711ab892556310cdc2b52ebf5b3
--- /dev/null
+++ b/android_webview/browser/aw_printing_message_filter.h
@@ -0,0 +1,40 @@
+// Copyright 2015 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.
+
+#ifndef ANDROID_WEBVIEW_BROWSER_PRINTING_MESSAGE_FILTER_H_
+#define ANDROID_WEBVIEW_BROWSER_PRINTING_MESSAGE_FILTER_H_
+
+#include "content/public/browser/browser_message_filter.h"
+
+namespace android_webview {
+
+// This class filters out incoming printing related IPC messages for the
+// renderer process on the IPC thread.
+class AwPrintingMessageFilter : public content::BrowserMessageFilter {
+ public:
+ AwPrintingMessageFilter(int render_process_id);
+
+ // content::BrowserMessageFilter methods.
+ void OverrideThreadForMessage(const IPC::Message& message,
+ content::BrowserThread::ID* thread) override;
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ private:
+ ~AwPrintingMessageFilter() override;
+
+ // Used to ask the browser allocate a temporary file for the renderer
+ // to fill in resulting PDF in renderer.
+ void OnAllocateTempFileForPrinting(int render_view_id,
+ base::FileDescriptor* temp_file_fd,
+ int* sequence_number);
+ void OnTempFileForPrintingWritten(int render_view_id, int sequence_number);
+
+ const int render_process_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(AwPrintingMessageFilter);
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_BROWSER_PRINTING_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698