OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/mock_render_thread.h" | 5 #include "chrome/renderer/mock_render_thread.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 bool msg_is_ok = true; | 97 bool msg_is_ok = true; |
98 IPC_BEGIN_MESSAGE_MAP_EX(MockRenderThread, msg, msg_is_ok) | 98 IPC_BEGIN_MESSAGE_MAP_EX(MockRenderThread, msg, msg_is_ok) |
99 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWidget, OnMsgCreateWidget) | 99 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWidget, OnMsgCreateWidget) |
100 IPC_MESSAGE_HANDLER(ExtensionHostMsg_OpenChannelToExtension, | 100 IPC_MESSAGE_HANDLER(ExtensionHostMsg_OpenChannelToExtension, |
101 OnMsgOpenChannelToExtension) | 101 OnMsgOpenChannelToExtension) |
102 IPC_MESSAGE_HANDLER(PrintHostMsg_GetDefaultPrintSettings, | 102 IPC_MESSAGE_HANDLER(PrintHostMsg_GetDefaultPrintSettings, |
103 OnGetDefaultPrintSettings) | 103 OnGetDefaultPrintSettings) |
104 IPC_MESSAGE_HANDLER(PrintHostMsg_ScriptedPrint, | 104 IPC_MESSAGE_HANDLER(PrintHostMsg_ScriptedPrint, |
105 OnScriptedPrint) | 105 OnScriptedPrint) |
106 #if defined(OS_WIN) || defined(OS_MACOSX) | 106 #if defined(OS_WIN) || defined(OS_MACOSX) |
107 IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPrintedPagesCount, | 107 IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetBasicPrintJobInfo, |
108 OnDidGetPrintedPagesCount) | 108 OnDidGetBasicPrintJobInfo) |
109 IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage) | 109 IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage) |
110 #endif | 110 #endif |
111 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
112 IPC_MESSAGE_HANDLER(PrintHostMsg_DuplicateSection, OnDuplicateSection) | 112 IPC_MESSAGE_HANDLER(PrintHostMsg_DuplicateSection, OnDuplicateSection) |
113 #endif | 113 #endif |
114 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateSharedMemoryBuffer, | 114 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateSharedMemoryBuffer, |
115 OnAllocateSharedMemoryBuffer) | 115 OnAllocateSharedMemoryBuffer) |
116 #if defined(OS_CHROMEOS) | 116 #if defined(OS_CHROMEOS) |
117 IPC_MESSAGE_HANDLER(PrintHostMsg_AllocateTempFileForPrinting, | 117 IPC_MESSAGE_HANDLER(PrintHostMsg_AllocateTempFileForPrinting, |
118 OnAllocateTempFileForPrinting) | 118 OnAllocateTempFileForPrinting) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 const PrintHostMsg_ScriptedPrint_Params& params, | 190 const PrintHostMsg_ScriptedPrint_Params& params, |
191 PrintMsg_PrintPages_Params* settings) { | 191 PrintMsg_PrintPages_Params* settings) { |
192 if (print_dialog_user_response_ && printer_.get()) { | 192 if (print_dialog_user_response_ && printer_.get()) { |
193 printer_->ScriptedPrint(params.cookie, | 193 printer_->ScriptedPrint(params.cookie, |
194 params.expected_pages_count, | 194 params.expected_pages_count, |
195 params.has_selection, | 195 params.has_selection, |
196 settings); | 196 settings); |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 void MockRenderThread::OnDidGetPrintedPagesCount(int cookie, int number_pages) { | 200 void MockRenderThread::OnDidGetBasicPrintJobInfo( |
| 201 int cookie, int number_pages, const string16& job_title) { |
201 if (printer_.get()) | 202 if (printer_.get()) |
202 printer_->SetPrintedPagesCount(cookie, number_pages); | 203 printer_->SetPrintedPagesCount(cookie, number_pages); |
203 } | 204 } |
204 | 205 |
205 void MockRenderThread::OnDidPrintPage( | 206 void MockRenderThread::OnDidPrintPage( |
206 const PrintHostMsg_DidPrintPage_Params& params) { | 207 const PrintHostMsg_DidPrintPage_Params& params) { |
207 if (printer_.get()) | 208 if (printer_.get()) |
208 printer_->PrintPage(params); | 209 printer_->PrintPage(params); |
209 } | 210 } |
210 | 211 |
211 void MockRenderThread::set_print_dialog_user_response(bool response) { | 212 void MockRenderThread::set_print_dialog_user_response(bool response) { |
212 print_dialog_user_response_ = response; | 213 print_dialog_user_response_ = response; |
213 } | 214 } |
OLD | NEW |