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 // IPC messages for printing. | 5 // IPC messages for printing. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 | 42 |
43 // Cookie for the document to ensure correctness. | 43 // Cookie for the document to ensure correctness. |
44 IPC_STRUCT_MEMBER(int, document_cookie) | 44 IPC_STRUCT_MEMBER(int, document_cookie) |
45 | 45 |
46 // Should only print currently selected text. | 46 // Should only print currently selected text. |
47 IPC_STRUCT_MEMBER(bool, selection_only) | 47 IPC_STRUCT_MEMBER(bool, selection_only) |
48 | 48 |
49 // Does the printer support alpha blending? | 49 // Does the printer support alpha blending? |
50 IPC_STRUCT_MEMBER(bool, supports_alpha_blend) | 50 IPC_STRUCT_MEMBER(bool, supports_alpha_blend) |
51 | 51 |
52 // The id of the preview request, used only for print preview. | 52 // *** Parameters below are used only for print preview. *** |
53 | |
54 // The print preview ui associated with this request. | |
55 IPC_STRUCT_MEMBER(std::string, preview_ui_addr) | |
Lei Zhang
2011/08/20 03:25:52
This is going to cause a crash when we do a memset
| |
56 | |
57 // The id of the preview request. | |
53 IPC_STRUCT_MEMBER(int, preview_request_id) | 58 IPC_STRUCT_MEMBER(int, preview_request_id) |
54 | 59 |
55 // True if this is the first preview request, used only for print preview. | 60 // True if this is the first preview request. |
56 IPC_STRUCT_MEMBER(bool, is_first_request) | 61 IPC_STRUCT_MEMBER(bool, is_first_request) |
57 | 62 |
58 // Specifies if the header and footer should be rendered. | 63 // Specifies if the header and footer should be rendered. |
59 IPC_STRUCT_MEMBER(bool, display_header_footer) | 64 IPC_STRUCT_MEMBER(bool, display_header_footer) |
60 | 65 |
61 // Date string to be printed as header if requested by the user. | 66 // Date string to be printed as header if requested by the user. |
62 IPC_STRUCT_MEMBER(string16, date) | 67 IPC_STRUCT_MEMBER(string16, date) |
63 | 68 |
64 // Title string to be printed as header if requested by the user. | 69 // Title string to be printed as header if requested by the user. |
65 IPC_STRUCT_MEMBER(string16, title) | 70 IPC_STRUCT_MEMBER(string16, title) |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 // called multiple times as the user updates settings. | 218 // called multiple times as the user updates settings. |
214 IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview, | 219 IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview, |
215 DictionaryValue /* settings */) | 220 DictionaryValue /* settings */) |
216 | 221 |
217 // Like PrintMsg_PrintPages, but using the print preview document's frame/node. | 222 // Like PrintMsg_PrintPages, but using the print preview document's frame/node. |
218 IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog) | 223 IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog) |
219 | 224 |
220 // Tells a renderer to stop blocking script initiated printing. | 225 // Tells a renderer to stop blocking script initiated printing. |
221 IPC_MESSAGE_ROUTED0(PrintMsg_ResetScriptedPrintCount) | 226 IPC_MESSAGE_ROUTED0(PrintMsg_ResetScriptedPrintCount) |
222 | 227 |
223 // Tells a renderer to continue generating the print preview. | |
224 // Use |requested_preview_page_index| to request a specific preview page data. | |
225 // |requested_preview_page_index| is 1-based or |printing::INVALID_PAGE_INDEX| | |
226 // to render the next page. | |
227 IPC_MESSAGE_ROUTED1(PrintMsg_ContinuePreview, | |
228 int /* requested_preview_page_index */) | |
229 | |
230 // Tells a renderer to abort the print preview and reset all state. | |
231 IPC_MESSAGE_ROUTED0(PrintMsg_AbortPreview) | |
232 | |
233 // Messages sent from the renderer to the browser. | 228 // Messages sent from the renderer to the browser. |
234 | 229 |
235 #if defined(OS_WIN) | 230 #if defined(OS_WIN) |
236 // Duplicates a shared memory handle from the renderer to the browser. Then | 231 // Duplicates a shared memory handle from the renderer to the browser. Then |
237 // the renderer can flush the handle. | 232 // the renderer can flush the handle. |
238 IPC_SYNC_MESSAGE_ROUTED1_1(PrintHostMsg_DuplicateSection, | 233 IPC_SYNC_MESSAGE_ROUTED1_1(PrintHostMsg_DuplicateSection, |
239 base::SharedMemoryHandle /* renderer handle */, | 234 base::SharedMemoryHandle /* renderer handle */, |
240 base::SharedMemoryHandle /* browser handle */) | 235 base::SharedMemoryHandle /* browser handle */) |
241 #endif | 236 #endif |
242 | 237 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 IPC_MESSAGE_ROUTED0(PrintHostMsg_RequestPrintPreview) | 288 IPC_MESSAGE_ROUTED0(PrintHostMsg_RequestPrintPreview) |
294 | 289 |
295 // Notify the browser the number of pages in the print preview document. | 290 // Notify the browser the number of pages in the print preview document. |
296 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, | 291 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, |
297 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) | 292 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) |
298 | 293 |
299 // Notify the browser a print preview page has been rendered. | 294 // Notify the browser a print preview page has been rendered. |
300 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage, | 295 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage, |
301 PrintHostMsg_DidPreviewPage_Params /* params */) | 296 PrintHostMsg_DidPreviewPage_Params /* params */) |
302 | 297 |
298 // Asks the browser whether the print preview has been cancelled, | |
299 // and if not, what page to render next. | |
300 IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, | |
301 std::string /* print preview ui address */, | |
302 int /* request id */, | |
303 bool /* print preview cancelled */) | |
304 | |
303 // Sends back to the browser the complete rendered document for print preview | 305 // Sends back to the browser the complete rendered document for print preview |
304 // that was requested by a PrintMsg_PrintPreview message. The memory handle in | 306 // that was requested by a PrintMsg_PrintPreview message. The memory handle in |
305 // this message is already valid in the browser process. | 307 // this message is already valid in the browser process. |
306 IPC_MESSAGE_ROUTED1(PrintHostMsg_PagesReadyForPreview, | 308 IPC_MESSAGE_ROUTED1(PrintHostMsg_PagesReadyForPreview, |
307 PrintHostMsg_DidPreviewDocument_Params /* params */) | 309 PrintHostMsg_DidPreviewDocument_Params /* params */) |
308 | 310 |
309 // Tell the browser printing failed. | 311 // Tell the browser printing failed. |
310 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, | 312 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, |
311 int /* document cookie */) | 313 int /* document cookie */) |
312 | 314 |
313 // Tell the browser print preview failed. | 315 // Tell the browser print preview failed. |
314 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, | 316 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, |
315 int /* document cookie */) | 317 int /* document cookie */) |
318 | |
319 // Tell the browser print preview was cancelled. | |
320 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewCancelled, | |
321 int /* document cookie */) | |
OLD | NEW |