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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 361 |
360 // 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 |
361 // 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 |
362 // final print settings. The output parameter is the same as | 364 // final print settings. The output parameter is the same as |
363 // ViewMsg_PrintPages which is executed implicitly. | 365 // ViewMsg_PrintPages which is executed implicitly. |
364 IPC_SYNC_MESSAGE_ROUTED1_1(PrintHostMsg_ScriptedPrint, | 366 IPC_SYNC_MESSAGE_ROUTED1_1(PrintHostMsg_ScriptedPrint, |
365 PrintHostMsg_ScriptedPrint_Params, | 367 PrintHostMsg_ScriptedPrint_Params, |
366 PrintMsg_PrintPages_Params | 368 PrintMsg_PrintPages_Params |
367 /* settings chosen by the user*/) | 369 /* settings chosen by the user*/) |
368 | 370 |
369 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 371 #if defined(OS_ANDROID) |
370 // 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 |
371 // in resulting NativeMetafile in printing. | 373 // in resulting NativeMetafile in printing. |
372 IPC_SYNC_MESSAGE_CONTROL1_2(PrintHostMsg_AllocateTempFileForPrinting, | 374 IPC_SYNC_MESSAGE_ROUTED0_2(PrintHostMsg_AllocateTempFileForPrinting, |
373 int /* render_view_id */, | 375 base::FileDescriptor /* temp file fd */, |
374 base::FileDescriptor /* temp file fd */, | 376 int /* fd in browser*/) |
375 int /* fd in browser*/) // Used only by Chrome OS. | 377 IPC_MESSAGE_ROUTED1(PrintHostMsg_TempFileForPrintingWritten, |
376 IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, | 378 int /* fd in browser */) |
377 int /* render_view_id */, | |
378 int /* fd in browser */) // Used only by Chrome OS. | |
379 #endif | 379 #endif |
380 | |
381 // Asks the browser to do print preview. | 380 // Asks the browser to do print preview. |
382 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, | 381 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, |
383 PrintHostMsg_RequestPrintPreview_Params /* params */) | 382 PrintHostMsg_RequestPrintPreview_Params /* params */) |
384 | 383 |
385 // 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. |
386 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, | 385 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, |
387 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) | 386 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) |
388 | 387 |
389 // 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 |
390 // selected printer and page size. | 389 // selected printer and page size. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) | 434 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) |
436 | 435 |
437 // 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 |
438 // 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. |
439 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, | 438 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, |
440 bool /* is_modifiable */) | 439 bool /* is_modifiable */) |
441 | 440 |
442 // 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 |
443 // scaling option. | 442 // scaling option. |
444 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) | 443 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) |
OLD | NEW |