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

Unified Diff: chrome/renderer/chrome_mock_render_thread.cc

Issue 22577010: Printing: Add a basic printing mode without print preview and cloud print. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « chrome/renderer/chrome_mock_render_thread.h ('k') | chrome/renderer/pepper/pepper_pdf_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_mock_render_thread.cc
diff --git a/chrome/renderer/chrome_mock_render_thread.cc b/chrome/renderer/chrome_mock_render_thread.cc
index 79d7361ac4b0d9ccdb33ed94334ef7897ec5f227..c4bb9c014f9b998ab2400cbc6d952413fde29e7f 100644
--- a/chrome/renderer/chrome_mock_render_thread.cc
+++ b/chrome/renderer/chrome_mock_render_thread.cc
@@ -8,7 +8,6 @@
#include "base/values.h"
#include "chrome/common/extensions/extension_messages.h"
-#include "chrome/common/print_messages.h"
#include "chrome/renderer/mock_printer.h"
#include "ipc/ipc_sync_message.h"
#include "printing/print_job_constants.h"
@@ -21,11 +20,18 @@
#include "base/file_util.h"
#endif
+#if defined(ENABLE_PRINTING)
+#include "chrome/common/print_messages.h"
+#endif
+
ChromeMockRenderThread::ChromeMockRenderThread()
+#if defined(ENABLE_PRINTING)
: printer_(new MockPrinter),
print_dialog_user_response_(true),
print_preview_cancel_page_number_(-1),
- print_preview_pages_remaining_(0) {
+ print_preview_pages_remaining_(0)
+#endif
+{
}
ChromeMockRenderThread::~ChromeMockRenderThread() {
@@ -41,6 +47,7 @@ bool ChromeMockRenderThread::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP_EX(ChromeMockRenderThread, msg, msg_is_ok)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_OpenChannelToExtension,
OnOpenChannelToExtension)
+#if defined(ENABLE_PRINTING)
IPC_MESSAGE_HANDLER(PrintHostMsg_GetDefaultPrintSettings,
OnGetDefaultPrintSettings)
IPC_MESSAGE_HANDLER(PrintHostMsg_ScriptedPrint, OnScriptedPrint)
@@ -60,7 +67,8 @@ bool ChromeMockRenderThread::OnMessageReceived(const IPC::Message& msg) {
OnAllocateTempFileForPrinting)
IPC_MESSAGE_HANDLER(PrintHostMsg_TempFileForPrintingWritten,
OnTempFileForPrintingWritten)
-#endif
+#endif // defined(OS_CHROMEOS)
+#endif // defined(ENABLE_PRINTING)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
return handled;
@@ -74,6 +82,7 @@ void ChromeMockRenderThread::OnOpenChannelToExtension(
*port_id = 0;
}
+#if defined(ENABLE_PRINTING)
#if defined(OS_CHROMEOS)
void ChromeMockRenderThread::OnAllocateTempFileForPrinting(
base::FileDescriptor* renderer_fd,
@@ -205,3 +214,4 @@ void ChromeMockRenderThread::set_print_preview_cancel_page_number(int page) {
int ChromeMockRenderThread::print_preview_pages_remaining() const {
return print_preview_pages_remaining_;
}
+#endif // defined(ENABLE_PRINTING)
« no previous file with comments | « chrome/renderer/chrome_mock_render_thread.h ('k') | chrome/renderer/pepper/pepper_pdf_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698