Chromium Code Reviews| 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 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
| 14 #include "printing/page_range.h" | |
| 14 #include "printing/page_size_margins.h" | 15 #include "printing/page_size_margins.h" |
| 15 #include "printing/print_job_constants.h" | 16 #include "printing/print_job_constants.h" |
| 16 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 17 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
| 17 #include "ui/gfx/ipc/gfx_param_traits.h" | 18 #include "ui/gfx/ipc/gfx_param_traits.h" |
| 18 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
| 19 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
| 20 | 21 |
| 21 #ifndef CHROME_COMMON_PRINT_MESSAGES_H_ | 22 #ifndef CHROME_COMMON_PRINT_MESSAGES_H_ |
| 22 #define CHROME_COMMON_PRINT_MESSAGES_H_ | 23 #define CHROME_COMMON_PRINT_MESSAGES_H_ |
| 23 | 24 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 65 |
| 65 struct PrintHostMsg_RequestPrintPreview_Params { | 66 struct PrintHostMsg_RequestPrintPreview_Params { |
| 66 PrintHostMsg_RequestPrintPreview_Params(); | 67 PrintHostMsg_RequestPrintPreview_Params(); |
| 67 ~PrintHostMsg_RequestPrintPreview_Params(); | 68 ~PrintHostMsg_RequestPrintPreview_Params(); |
| 68 bool is_modifiable; | 69 bool is_modifiable; |
| 69 bool webnode_only; | 70 bool webnode_only; |
| 70 bool has_selection; | 71 bool has_selection; |
| 71 bool selection_only; | 72 bool selection_only; |
| 72 }; | 73 }; |
| 73 | 74 |
| 75 struct PrintHostMsg_SetOptionsFromDocument_Params { | |
| 76 PrintHostMsg_SetOptionsFromDocument_Params(); | |
|
jochen (gone - plz use gerrit)
2014/07/16 08:53:37
can you make the ctor and dtor inline please?
Nikhil
2014/07/16 09:26:57
I followed style currently followed in the file. B
| |
| 77 ~PrintHostMsg_SetOptionsFromDocument_Params(); | |
| 78 | |
| 79 bool is_scaling_disabled; | |
| 80 int copies; | |
| 81 printing::DuplexMode duplex; | |
| 82 printing::PageRanges page_ranges; | |
|
jochen (gone - plz use gerrit)
2014/07/16 08:53:37
why is page_ranges not initialized by your ctor?
Nikhil
2014/07/16 09:26:57
Based on review comment on patchset 1 (line 88).
| |
| 83 }; | |
| 84 | |
| 74 #endif // CHROME_COMMON_PRINT_MESSAGES_H_ | 85 #endif // CHROME_COMMON_PRINT_MESSAGES_H_ |
| 75 | 86 |
| 76 #define IPC_MESSAGE_START PrintMsgStart | 87 #define IPC_MESSAGE_START PrintMsgStart |
| 77 | 88 |
| 78 IPC_ENUM_TRAITS_MAX_VALUE(printing::MarginType, | 89 IPC_ENUM_TRAITS_MAX_VALUE(printing::MarginType, |
| 79 printing::MARGIN_TYPE_LAST) | 90 printing::MARGIN_TYPE_LAST) |
| 80 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPrintScalingOption, | 91 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPrintScalingOption, |
| 81 blink::WebPrintScalingOptionLast) | 92 blink::WebPrintScalingOptionLast) |
| 93 IPC_ENUM_TRAITS_MAX_VALUE(printing::DuplexMode, | |
| 94 printing::DUPLEX_MODE_LAST) | |
| 82 | 95 |
| 83 // Parameters for a render request. | 96 // Parameters for a render request. |
| 84 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) | 97 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) |
| 85 // Physical size of the page, including non-printable margins, | 98 // Physical size of the page, including non-printable margins, |
| 86 // in pixels according to dpi. | 99 // in pixels according to dpi. |
| 87 IPC_STRUCT_TRAITS_MEMBER(page_size) | 100 IPC_STRUCT_TRAITS_MEMBER(page_size) |
| 88 | 101 |
| 89 // In pixels according to dpi_x and dpi_y. | 102 // In pixels according to dpi_x and dpi_y. |
| 90 IPC_STRUCT_TRAITS_MEMBER(content_size) | 103 IPC_STRUCT_TRAITS_MEMBER(content_size) |
| 91 | 104 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 IPC_STRUCT_MEMBER(int, page_number) | 172 IPC_STRUCT_MEMBER(int, page_number) |
| 160 IPC_STRUCT_END() | 173 IPC_STRUCT_END() |
| 161 | 174 |
| 162 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) | 175 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) |
| 163 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) | 176 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) |
| 164 IPC_STRUCT_TRAITS_MEMBER(webnode_only) | 177 IPC_STRUCT_TRAITS_MEMBER(webnode_only) |
| 165 IPC_STRUCT_TRAITS_MEMBER(has_selection) | 178 IPC_STRUCT_TRAITS_MEMBER(has_selection) |
| 166 IPC_STRUCT_TRAITS_MEMBER(selection_only) | 179 IPC_STRUCT_TRAITS_MEMBER(selection_only) |
| 167 IPC_STRUCT_TRAITS_END() | 180 IPC_STRUCT_TRAITS_END() |
| 168 | 181 |
| 182 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params) | |
| 183 // Specifies whether print scaling is enabled or not. | |
| 184 IPC_STRUCT_TRAITS_MEMBER(is_scaling_disabled) | |
| 185 | |
| 186 // Specifies number of copies to be printed. | |
| 187 IPC_STRUCT_TRAITS_MEMBER(copies) | |
| 188 | |
| 189 // Specifies paper handling option. | |
| 190 IPC_STRUCT_TRAITS_MEMBER(duplex) | |
| 191 | |
| 192 // Specifies page range to be printed. | |
| 193 IPC_STRUCT_TRAITS_MEMBER(page_ranges) | |
| 194 IPC_STRUCT_TRAITS_END() | |
| 195 | |
| 169 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) | 196 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) |
| 170 IPC_STRUCT_TRAITS_MEMBER(content_width) | 197 IPC_STRUCT_TRAITS_MEMBER(content_width) |
| 171 IPC_STRUCT_TRAITS_MEMBER(content_height) | 198 IPC_STRUCT_TRAITS_MEMBER(content_height) |
| 172 IPC_STRUCT_TRAITS_MEMBER(margin_left) | 199 IPC_STRUCT_TRAITS_MEMBER(margin_left) |
| 173 IPC_STRUCT_TRAITS_MEMBER(margin_right) | 200 IPC_STRUCT_TRAITS_MEMBER(margin_right) |
| 174 IPC_STRUCT_TRAITS_MEMBER(margin_top) | 201 IPC_STRUCT_TRAITS_MEMBER(margin_top) |
| 175 IPC_STRUCT_TRAITS_MEMBER(margin_bottom) | 202 IPC_STRUCT_TRAITS_MEMBER(margin_bottom) |
| 176 IPC_STRUCT_TRAITS_END() | 203 IPC_STRUCT_TRAITS_END() |
| 177 | 204 |
| 178 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) | 205 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 | 463 |
| 437 // Run a nested message loop in the renderer until print preview for | 464 // Run a nested message loop in the renderer until print preview for |
| 438 // window.print() finishes. | 465 // window.print() finishes. |
| 439 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) | 466 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) |
| 440 | 467 |
| 441 // Tell the browser to show the print preview, when the document is sufficiently | 468 // Tell the browser to show the print preview, when the document is sufficiently |
| 442 // loaded such that the renderer can determine whether it is modifiable or not. | 469 // loaded such that the renderer can determine whether it is modifiable or not. |
| 443 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, | 470 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, |
| 444 bool /* is_modifiable */) | 471 bool /* is_modifiable */) |
| 445 | 472 |
| 446 // Notify the browser that the PDF in the initiator renderer has disabled print | 473 // Notify the browser to set print presets based on source PDF document. |
| 447 // scaling option. | 474 IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, |
| 448 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) | 475 PrintHostMsg_SetOptionsFromDocument_Params /* params */) |
| OLD | NEW |