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 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 PrintMsg_PrintPages_Params(); | 55 PrintMsg_PrintPages_Params(); |
| 56 ~PrintMsg_PrintPages_Params(); | 56 ~PrintMsg_PrintPages_Params(); |
| 57 | 57 |
| 58 // Resets the members of the struct to 0. | 58 // Resets the members of the struct to 0. |
| 59 void Reset(); | 59 void Reset(); |
| 60 | 60 |
| 61 PrintMsg_Print_Params params; | 61 PrintMsg_Print_Params params; |
| 62 std::vector<int> pages; | 62 std::vector<int> pages; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 struct PrintHostMsg_RequestPrintPreview_Params { | |
|
gene
2013/02/04 18:37:35
Could you please make a constructor to initialize
Vitaly Buka (NO REVIEWS)
2013/02/04 18:45:59
Done.
| |
| 66 bool is_modifiable; | |
| 67 bool webnode_only; | |
| 68 bool has_selection; | |
| 69 bool selection_only; | |
| 70 }; | |
| 71 | |
| 65 #endif // CHROME_COMMON_PRINT_MESSAGES_H_ | 72 #endif // CHROME_COMMON_PRINT_MESSAGES_H_ |
| 66 | 73 |
| 67 #define IPC_MESSAGE_START PrintMsgStart | 74 #define IPC_MESSAGE_START PrintMsgStart |
| 68 | 75 |
| 69 IPC_ENUM_TRAITS(printing::MarginType) | 76 IPC_ENUM_TRAITS(printing::MarginType) |
| 70 IPC_ENUM_TRAITS(WebKit::WebPrintScalingOption) | 77 IPC_ENUM_TRAITS(WebKit::WebPrintScalingOption) |
| 71 | 78 |
| 72 // Parameters for a render request. | 79 // Parameters for a render request. |
| 73 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) | 80 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) |
| 74 // Physical size of the page, including non-printable margins, | 81 // Physical size of the page, including non-printable margins, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 IPC_STRUCT_BEGIN(PrintMsg_PrintPage_Params) | 151 IPC_STRUCT_BEGIN(PrintMsg_PrintPage_Params) |
| 145 // Parameters to render the page as a printed page. It must always be the same | 152 // Parameters to render the page as a printed page. It must always be the same |
| 146 // value for all the document. | 153 // value for all the document. |
| 147 IPC_STRUCT_MEMBER(PrintMsg_Print_Params, params) | 154 IPC_STRUCT_MEMBER(PrintMsg_Print_Params, params) |
| 148 | 155 |
| 149 // The page number is the indicator of the square that should be rendered | 156 // The page number is the indicator of the square that should be rendered |
| 150 // according to the layout specified in PrintMsg_Print_Params. | 157 // according to the layout specified in PrintMsg_Print_Params. |
| 151 IPC_STRUCT_MEMBER(int, page_number) | 158 IPC_STRUCT_MEMBER(int, page_number) |
| 152 IPC_STRUCT_END() | 159 IPC_STRUCT_END() |
| 153 | 160 |
| 161 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) | |
| 162 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) | |
| 163 IPC_STRUCT_TRAITS_MEMBER(webnode_only) | |
| 164 IPC_STRUCT_TRAITS_MEMBER(has_selection) | |
| 165 IPC_STRUCT_TRAITS_MEMBER(selection_only) | |
| 166 IPC_STRUCT_TRAITS_END() | |
| 167 | |
| 154 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) | 168 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) |
| 155 IPC_STRUCT_TRAITS_MEMBER(content_width) | 169 IPC_STRUCT_TRAITS_MEMBER(content_width) |
| 156 IPC_STRUCT_TRAITS_MEMBER(content_height) | 170 IPC_STRUCT_TRAITS_MEMBER(content_height) |
| 157 IPC_STRUCT_TRAITS_MEMBER(margin_left) | 171 IPC_STRUCT_TRAITS_MEMBER(margin_left) |
| 158 IPC_STRUCT_TRAITS_MEMBER(margin_right) | 172 IPC_STRUCT_TRAITS_MEMBER(margin_right) |
| 159 IPC_STRUCT_TRAITS_MEMBER(margin_top) | 173 IPC_STRUCT_TRAITS_MEMBER(margin_top) |
| 160 IPC_STRUCT_TRAITS_MEMBER(margin_bottom) | 174 IPC_STRUCT_TRAITS_MEMBER(margin_bottom) |
| 161 IPC_STRUCT_TRAITS_END() | 175 IPC_STRUCT_TRAITS_END() |
| 162 | 176 |
| 163 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) | 177 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 IPC_STRUCT_MEMBER(int, cookie) | 272 IPC_STRUCT_MEMBER(int, cookie) |
| 259 IPC_STRUCT_MEMBER(int, expected_pages_count) | 273 IPC_STRUCT_MEMBER(int, expected_pages_count) |
| 260 IPC_STRUCT_MEMBER(bool, has_selection) | 274 IPC_STRUCT_MEMBER(bool, has_selection) |
| 261 IPC_STRUCT_MEMBER(printing::MarginType, margin_type) | 275 IPC_STRUCT_MEMBER(printing::MarginType, margin_type) |
| 262 IPC_STRUCT_END() | 276 IPC_STRUCT_END() |
| 263 | 277 |
| 264 | 278 |
| 265 // Messages sent from the browser to the renderer. | 279 // Messages sent from the browser to the renderer. |
| 266 | 280 |
| 267 // Tells the render view to initiate print preview for the entire document. | 281 // Tells the render view to initiate print preview for the entire document. |
| 268 IPC_MESSAGE_ROUTED0(PrintMsg_InitiatePrintPreview) | 282 IPC_MESSAGE_ROUTED1(PrintMsg_InitiatePrintPreview, bool /* selection_only */) |
| 269 | 283 |
| 270 // Tells the render view to initiate printing or print preview for a particular | 284 // Tells the render view to initiate printing or print preview for a particular |
| 271 // node, depending on which mode the render view is in. | 285 // node, depending on which mode the render view is in. |
| 272 IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu) | 286 IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu) |
| 273 | 287 |
| 274 // Tells the renderer to print the print preview tab's PDF plugin without | 288 // Tells the renderer to print the print preview tab's PDF plugin without |
| 275 // showing the print dialog. (This is the final step in the print preview | 289 // showing the print dialog. (This is the final step in the print preview |
| 276 // workflow.) | 290 // workflow.) |
| 277 IPC_MESSAGE_ROUTED1(PrintMsg_PrintForPrintPreview, | 291 IPC_MESSAGE_ROUTED1(PrintMsg_PrintForPrintPreview, |
| 278 DictionaryValue /* settings */) | 292 DictionaryValue /* settings */) |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 // in resulting NativeMetafile in printing. | 369 // in resulting NativeMetafile in printing. |
| 356 IPC_SYNC_MESSAGE_CONTROL0_2(PrintHostMsg_AllocateTempFileForPrinting, | 370 IPC_SYNC_MESSAGE_CONTROL0_2(PrintHostMsg_AllocateTempFileForPrinting, |
| 357 base::FileDescriptor /* temp file fd */, | 371 base::FileDescriptor /* temp file fd */, |
| 358 int /* fd in browser*/) | 372 int /* fd in browser*/) |
| 359 IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, | 373 IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, |
| 360 int /* render_view_id */, | 374 int /* render_view_id */, |
| 361 int /* fd in browser */) | 375 int /* fd in browser */) |
| 362 #endif | 376 #endif |
| 363 | 377 |
| 364 // Asks the browser to do print preview. | 378 // Asks the browser to do print preview. |
| 365 // |is_modifiable| is set to true when the request is for a web page, and false | 379 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, |
| 366 // for a PDF. | 380 PrintHostMsg_RequestPrintPreview_Params /* params */) |
| 367 // |webnode_only| is set to true if the document being printed is a specific | |
| 368 // WebNode, and false if the document is a full WebFrame. | |
| 369 IPC_MESSAGE_ROUTED3(PrintHostMsg_RequestPrintPreview, | |
| 370 bool /* is_modifiable */, | |
| 371 bool /* webnode_only */, | |
| 372 bool /* has_selection */) | |
| 373 | 381 |
| 374 // Notify the browser the number of pages in the print preview document. | 382 // Notify the browser the number of pages in the print preview document. |
| 375 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, | 383 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, |
| 376 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) | 384 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) |
| 377 | 385 |
| 378 // Notify the browser of the default page layout according to the currently | 386 // Notify the browser of the default page layout according to the currently |
| 379 // selected printer and page size. | 387 // selected printer and page size. |
| 380 // |printable_area_in_points| Specifies the printable area in points. | 388 // |printable_area_in_points| Specifies the printable area in points. |
| 381 // |has_custom_page_size_style| is true when the printing frame has a custom | 389 // |has_custom_page_size_style| is true when the printing frame has a custom |
| 382 // page size css otherwise false. | 390 // page size css otherwise false. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 420 int /* document cookie */) | 428 int /* document cookie */) |
| 421 | 429 |
| 422 // Run a nested message loop in the renderer until print preview for | 430 // Run a nested message loop in the renderer until print preview for |
| 423 // window.print() finishes. | 431 // window.print() finishes. |
| 424 IPC_SYNC_MESSAGE_ROUTED1_0(PrintHostMsg_ScriptedPrintPreview, | 432 IPC_SYNC_MESSAGE_ROUTED1_0(PrintHostMsg_ScriptedPrintPreview, |
| 425 bool /* is_modifiable */) | 433 bool /* is_modifiable */) |
| 426 | 434 |
| 427 // Notify the browser that the PDF in the initiator renderer has disabled print | 435 // Notify the browser that the PDF in the initiator renderer has disabled print |
| 428 // scaling option. | 436 // scaling option. |
| 429 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) | 437 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) |
| OLD | NEW |