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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 IPC_STRUCT_MEMBER(int, preview_request_id) | 52 IPC_STRUCT_MEMBER(int, preview_request_id) |
53 IPC_STRUCT_MEMBER(bool, is_first_request) | |
Lei Zhang
2011/08/06 00:52:57
nit: can you comment these two struct members and
dpapad
2011/08/06 01:21:20
Done.
| |
53 IPC_STRUCT_END() | 54 IPC_STRUCT_END() |
54 | 55 |
55 IPC_STRUCT_BEGIN(PrintMsg_PrintPage_Params) | 56 IPC_STRUCT_BEGIN(PrintMsg_PrintPage_Params) |
56 // Parameters to render the page as a printed page. It must always be the same | 57 // Parameters to render the page as a printed page. It must always be the same |
57 // value for all the document. | 58 // value for all the document. |
58 IPC_STRUCT_MEMBER(PrintMsg_Print_Params, params) | 59 IPC_STRUCT_MEMBER(PrintMsg_Print_Params, params) |
59 | 60 |
60 // The page number is the indicator of the square that should be rendered | 61 // The page number is the indicator of the square that should be rendered |
61 // according to the layout specified in PrintMsg_Print_Params. | 62 // according to the layout specified in PrintMsg_Print_Params. |
62 IPC_STRUCT_MEMBER(int, page_number) | 63 IPC_STRUCT_MEMBER(int, page_number) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewPage_Params) | 101 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewPage_Params) |
101 // A shared memory handle to metafile data for a draft document of the page. | 102 // A shared memory handle to metafile data for a draft document of the page. |
102 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) | 103 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) |
103 | 104 |
104 // Size of metafile data. | 105 // Size of metafile data. |
105 IPC_STRUCT_MEMBER(uint32, data_size) | 106 IPC_STRUCT_MEMBER(uint32, data_size) |
106 | 107 |
107 // |page_number| is zero-based and can be |printing::INVALID_PAGE_INDEX| if it | 108 // |page_number| is zero-based and can be |printing::INVALID_PAGE_INDEX| if it |
108 // is just a check. | 109 // is just a check. |
109 IPC_STRUCT_MEMBER(int, page_number) | 110 IPC_STRUCT_MEMBER(int, page_number) |
111 | |
112 // The id of the preview request. | |
113 IPC_STRUCT_MEMBER(int, preview_request_id) | |
110 IPC_STRUCT_END() | 114 IPC_STRUCT_END() |
111 | 115 |
112 // Parameters to describe a rendered page. | 116 // Parameters to describe a rendered page. |
113 IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) | 117 IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) |
114 // A shared memory handle to the EMF data. This data can be quite large so a | 118 // A shared memory handle to the EMF data. This data can be quite large so a |
115 // memory map needs to be used. | 119 // memory map needs to be used. |
116 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) | 120 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) |
117 | 121 |
118 // Size of the metafile data. | 122 // Size of the metafile data. |
119 IPC_STRUCT_MEMBER(uint32, data_size) | 123 IPC_STRUCT_MEMBER(uint32, data_size) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 base::FileDescriptor /* temp file fd */, | 256 base::FileDescriptor /* temp file fd */, |
253 int /* fd in browser*/) | 257 int /* fd in browser*/) |
254 IPC_MESSAGE_CONTROL1(PrintHostMsg_TempFileForPrintingWritten, | 258 IPC_MESSAGE_CONTROL1(PrintHostMsg_TempFileForPrintingWritten, |
255 int /* fd in browser */) | 259 int /* fd in browser */) |
256 #endif | 260 #endif |
257 | 261 |
258 // Asks the browser to do print preview. | 262 // Asks the browser to do print preview. |
259 IPC_MESSAGE_ROUTED0(PrintHostMsg_RequestPrintPreview) | 263 IPC_MESSAGE_ROUTED0(PrintHostMsg_RequestPrintPreview) |
260 | 264 |
261 // Notify the browser the number of pages in the print preview document. | 265 // Notify the browser the number of pages in the print preview document. |
262 IPC_MESSAGE_ROUTED3(PrintHostMsg_DidGetPreviewPageCount, | 266 IPC_MESSAGE_ROUTED4(PrintHostMsg_DidGetPreviewPageCount, |
263 int /* document cookie */, | 267 int /* document cookie */, |
264 int /* page count */, | 268 int /* page count */, |
265 bool /* is modifiable */) | 269 bool /* is modifiable */, |
270 int /* preview_request_id */) | |
266 | 271 |
267 // Notify the browser a print preview page has been rendered. | 272 // Notify the browser a print preview page has been rendered. |
268 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage, | 273 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage, |
269 PrintHostMsg_DidPreviewPage_Params /* params */) | 274 PrintHostMsg_DidPreviewPage_Params /* params */) |
270 | 275 |
271 // Sends back to the browser the complete rendered document for print preview | 276 // Sends back to the browser the complete rendered document for print preview |
272 // that was requested by a PrintMsg_PrintPreview message. The memory handle in | 277 // that was requested by a PrintMsg_PrintPreview message. The memory handle in |
273 // this message is already valid in the browser process. | 278 // this message is already valid in the browser process. |
274 IPC_MESSAGE_ROUTED1(PrintHostMsg_PagesReadyForPreview, | 279 IPC_MESSAGE_ROUTED1(PrintHostMsg_PagesReadyForPreview, |
275 PrintHostMsg_DidPreviewDocument_Params /* params */) | 280 PrintHostMsg_DidPreviewDocument_Params /* params */) |
276 | 281 |
277 // Tell the browser printing failed. | 282 // Tell the browser printing failed. |
278 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, | 283 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, |
279 int /* document cookie */) | 284 int /* document cookie */) |
280 | 285 |
281 // Tell the browser print preview failed. | 286 // Tell the browser print preview failed. |
282 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, | 287 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, |
283 int /* document cookie */) | 288 int /* document cookie */) |
OLD | NEW |