OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(sgurun) copied from chrome/common. Remove after crbug.com/322276 |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
12 #include "base/values.h" | 14 #include "base/values.h" |
13 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
14 #include "printing/page_size_margins.h" | 16 #include "printing/page_size_margins.h" |
15 #include "printing/print_job_constants.h" | 17 #include "printing/print_job_constants.h" |
16 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 18 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
17 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
18 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
19 | 21 |
20 #ifndef CHROME_COMMON_PRINT_MESSAGES_H_ | 22 #ifndef AW_COMMON_PRINT_MESSAGES_H_ |
21 #define CHROME_COMMON_PRINT_MESSAGES_H_ | 23 #define AW_COMMON_PRINT_MESSAGES_H_ |
22 | 24 |
23 struct PrintMsg_Print_Params { | 25 struct PrintMsg_Print_Params { |
24 PrintMsg_Print_Params(); | 26 PrintMsg_Print_Params(); |
25 ~PrintMsg_Print_Params(); | 27 ~PrintMsg_Print_Params(); |
26 | 28 |
27 // Resets the members of the struct to 0. | 29 // Resets the members of the struct to 0. |
28 void Reset(); | 30 void Reset(); |
29 | 31 |
30 gfx::Size page_size; | 32 gfx::Size page_size; |
31 gfx::Size content_size; | 33 gfx::Size content_size; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 65 |
64 struct PrintHostMsg_RequestPrintPreview_Params { | 66 struct PrintHostMsg_RequestPrintPreview_Params { |
65 PrintHostMsg_RequestPrintPreview_Params(); | 67 PrintHostMsg_RequestPrintPreview_Params(); |
66 ~PrintHostMsg_RequestPrintPreview_Params(); | 68 ~PrintHostMsg_RequestPrintPreview_Params(); |
67 bool is_modifiable; | 69 bool is_modifiable; |
68 bool webnode_only; | 70 bool webnode_only; |
69 bool has_selection; | 71 bool has_selection; |
70 bool selection_only; | 72 bool selection_only; |
71 }; | 73 }; |
72 | 74 |
73 #endif // CHROME_COMMON_PRINT_MESSAGES_H_ | 75 #endif // AW_COMMON_PRINT_MESSAGES_H_ |
74 | 76 |
75 #define IPC_MESSAGE_START PrintMsgStart | 77 #define IPC_MESSAGE_START PrintMsgStart |
76 | 78 |
77 IPC_ENUM_TRAITS(printing::MarginType) | 79 IPC_ENUM_TRAITS(printing::MarginType) |
78 IPC_ENUM_TRAITS(blink::WebPrintScalingOption) | 80 IPC_ENUM_TRAITS(blink::WebPrintScalingOption) |
79 | 81 |
80 // Parameters for a render request. | 82 // Parameters for a render request. |
81 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) | 83 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) |
82 // Physical size of the page, including non-printable margins, | 84 // Physical size of the page, including non-printable margins, |
83 // in pixels according to dpi. | 85 // in pixels according to dpi. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // Parameters to render the page as a printed page. It must always be the same | 178 // Parameters to render the page as a printed page. It must always be the same |
177 // value for all the document. | 179 // value for all the document. |
178 IPC_STRUCT_TRAITS_MEMBER(params) | 180 IPC_STRUCT_TRAITS_MEMBER(params) |
179 | 181 |
180 // If empty, this means a request to render all the printed pages. | 182 // If empty, this means a request to render all the printed pages. |
181 IPC_STRUCT_TRAITS_MEMBER(pages) | 183 IPC_STRUCT_TRAITS_MEMBER(pages) |
182 IPC_STRUCT_TRAITS_END() | 184 IPC_STRUCT_TRAITS_END() |
183 | 185 |
184 // Parameters to describe a rendered document. | 186 // Parameters to describe a rendered document. |
185 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params) | 187 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params) |
| 188 // True when we can reuse existing preview data. |metafile_data_handle| and |
| 189 // |data_size| should not be used when this is true. |
| 190 IPC_STRUCT_MEMBER(bool, reuse_existing_data) |
| 191 |
186 // A shared memory handle to metafile data. | 192 // A shared memory handle to metafile data. |
187 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) | 193 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) |
188 | 194 |
189 // Size of metafile data. | 195 // Size of metafile data. |
190 IPC_STRUCT_MEMBER(uint32, data_size) | 196 IPC_STRUCT_MEMBER(uint32, data_size) |
191 | 197 |
192 // Cookie for the document to ensure correctness. | 198 // Cookie for the document to ensure correctness. |
193 IPC_STRUCT_MEMBER(int, document_cookie) | 199 IPC_STRUCT_MEMBER(int, document_cookie) |
194 | 200 |
195 // Store the expected pages count. | 201 // Store the expected pages count. |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 361 |
356 // It's the renderer that controls the printing process when it is generated | 362 // It's the renderer that controls the printing process when it is generated |
357 // by javascript. This step is about showing UI to the user to select the | 363 // by javascript. This step is about showing UI to the user to select the |
358 // final print settings. The output parameter is the same as | 364 // final print settings. The output parameter is the same as |
359 // ViewMsg_PrintPages which is executed implicitly. | 365 // ViewMsg_PrintPages which is executed implicitly. |
360 IPC_SYNC_MESSAGE_ROUTED1_1(PrintHostMsg_ScriptedPrint, | 366 IPC_SYNC_MESSAGE_ROUTED1_1(PrintHostMsg_ScriptedPrint, |
361 PrintHostMsg_ScriptedPrint_Params, | 367 PrintHostMsg_ScriptedPrint_Params, |
362 PrintMsg_PrintPages_Params | 368 PrintMsg_PrintPages_Params |
363 /* settings chosen by the user*/) | 369 /* settings chosen by the user*/) |
364 | 370 |
365 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 371 #if defined(OS_ANDROID) |
366 // Asks the browser to create a temporary file for the renderer to fill | 372 // Asks the browser to create a temporary file for the renderer to fill |
367 // in resulting NativeMetafile in printing. | 373 // in resulting NativeMetafile in printing. |
368 IPC_SYNC_MESSAGE_CONTROL1_2(PrintHostMsg_AllocateTempFileForPrinting, | 374 IPC_SYNC_MESSAGE_ROUTED0_2(PrintHostMsg_AllocateTempFileForPrinting, |
369 int /* render_view_id */, | 375 base::FileDescriptor /* temp file fd */, |
370 base::FileDescriptor /* temp file fd */, | 376 int /* fd in browser*/) |
371 int /* fd in browser*/) // Used only by Chrome OS. | 377 IPC_MESSAGE_ROUTED1(PrintHostMsg_TempFileForPrintingWritten, |
372 IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, | 378 int /* fd in browser */) |
373 int /* render_view_id */, | |
374 int /* fd in browser */) // Used only by Chrome OS. | |
375 #endif | 379 #endif |
376 | |
377 // Asks the browser to do print preview. | 380 // Asks the browser to do print preview. |
378 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, | 381 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, |
379 PrintHostMsg_RequestPrintPreview_Params /* params */) | 382 PrintHostMsg_RequestPrintPreview_Params /* params */) |
380 | 383 |
381 // Notify the browser the number of pages in the print preview document. | 384 // Notify the browser the number of pages in the print preview document. |
382 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, | 385 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, |
383 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) | 386 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) |
384 | 387 |
385 // Notify the browser of the default page layout according to the currently | 388 // Notify the browser of the default page layout according to the currently |
386 // selected printer and page size. | 389 // selected printer and page size. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) | 434 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) |
432 | 435 |
433 // Tell the browser to show the print preview, when the document is sufficiently | 436 // Tell the browser to show the print preview, when the document is sufficiently |
434 // loaded such that the renderer can determine whether it is modifiable or not. | 437 // loaded such that the renderer can determine whether it is modifiable or not. |
435 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, | 438 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, |
436 bool /* is_modifiable */) | 439 bool /* is_modifiable */) |
437 | 440 |
438 // Notify the browser that the PDF in the initiator renderer has disabled print | 441 // Notify the browser that the PDF in the initiator renderer has disabled print |
439 // scaling option. | 442 // scaling option. |
440 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) | 443 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) |
OLD | NEW |