| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "components/printing/common/printing_param_traits_macros.h" | 16 #include "components/printing/common/printing_param_traits_macros.h" |
| 17 #include "ipc/ipc_message_macros.h" | 17 #include "ipc/ipc_message_macros.h" |
| 18 #include "printing/common/pdf_metafile_utils.h" |
| 18 #include "printing/features/features.h" | 19 #include "printing/features/features.h" |
| 19 #include "printing/page_range.h" | 20 #include "printing/page_range.h" |
| 20 #include "printing/page_size_margins.h" | 21 #include "printing/page_size_margins.h" |
| 21 #include "printing/print_job_constants.h" | 22 #include "printing/print_job_constants.h" |
| 22 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 23 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
| 23 #include "ui/gfx/geometry/point.h" | 24 #include "ui/gfx/geometry/point.h" |
| 24 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
| 25 #include "ui/gfx/ipc/geometry/gfx_param_traits.h" | 26 #include "ui/gfx/ipc/geometry/gfx_param_traits.h" |
| 26 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" | 27 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" |
| 27 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 53 bool supports_alpha_blend; | 54 bool supports_alpha_blend; |
| 54 int32_t preview_ui_id; | 55 int32_t preview_ui_id; |
| 55 int preview_request_id; | 56 int preview_request_id; |
| 56 bool is_first_request; | 57 bool is_first_request; |
| 57 blink::WebPrintScalingOption print_scaling_option; | 58 blink::WebPrintScalingOption print_scaling_option; |
| 58 bool print_to_pdf; | 59 bool print_to_pdf; |
| 59 bool display_header_footer; | 60 bool display_header_footer; |
| 60 base::string16 title; | 61 base::string16 title; |
| 61 base::string16 url; | 62 base::string16 url; |
| 62 bool should_print_backgrounds; | 63 bool should_print_backgrounds; |
| 64 printing::SkiaDocumentType printed_doc_type; |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 struct PrintMsg_PrintPages_Params { | 67 struct PrintMsg_PrintPages_Params { |
| 66 PrintMsg_PrintPages_Params(); | 68 PrintMsg_PrintPages_Params(); |
| 67 PrintMsg_PrintPages_Params(const PrintMsg_PrintPages_Params& other); | 69 PrintMsg_PrintPages_Params(const PrintMsg_PrintPages_Params& other); |
| 68 ~PrintMsg_PrintPages_Params(); | 70 ~PrintMsg_PrintPages_Params(); |
| 69 | 71 |
| 70 // Resets the members of the struct to 0. | 72 // Resets the members of the struct to 0. |
| 71 void Reset(); | 73 void Reset(); |
| 72 | 74 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 94 printing::PageRanges page_ranges; | 96 printing::PageRanges page_ranges; |
| 95 }; | 97 }; |
| 96 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) | 98 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 97 | 99 |
| 98 #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ | 100 #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ |
| 99 | 101 |
| 100 #define IPC_MESSAGE_START PrintMsgStart | 102 #define IPC_MESSAGE_START PrintMsgStart |
| 101 | 103 |
| 102 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPrintScalingOption, | 104 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPrintScalingOption, |
| 103 blink::kWebPrintScalingOptionLast) | 105 blink::kWebPrintScalingOptionLast) |
| 106 IPC_ENUM_TRAITS_MAX_VALUE(printing::SkiaDocumentType, |
| 107 printing::SkiaDocumentType::MAX) |
| 104 | 108 |
| 105 // Parameters for a render request. | 109 // Parameters for a render request. |
| 106 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) | 110 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) |
| 107 // Physical size of the page, including non-printable margins, | 111 // Physical size of the page, including non-printable margins, |
| 108 // in pixels according to dpi. | 112 // in pixels according to dpi. |
| 109 IPC_STRUCT_TRAITS_MEMBER(page_size) | 113 IPC_STRUCT_TRAITS_MEMBER(page_size) |
| 110 | 114 |
| 111 // In pixels according to dpi_x and dpi_y. | 115 // In pixels according to dpi_x and dpi_y. |
| 112 IPC_STRUCT_TRAITS_MEMBER(content_size) | 116 IPC_STRUCT_TRAITS_MEMBER(content_size) |
| 113 | 117 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 IPC_STRUCT_TRAITS_MEMBER(title) | 163 IPC_STRUCT_TRAITS_MEMBER(title) |
| 160 | 164 |
| 161 // URL string to be printed as footer if requested by the user. | 165 // URL string to be printed as footer if requested by the user. |
| 162 IPC_STRUCT_TRAITS_MEMBER(url) | 166 IPC_STRUCT_TRAITS_MEMBER(url) |
| 163 | 167 |
| 164 // Whether to rasterize a PDF for printing | 168 // Whether to rasterize a PDF for printing |
| 165 IPC_STRUCT_TRAITS_MEMBER(rasterize_pdf) | 169 IPC_STRUCT_TRAITS_MEMBER(rasterize_pdf) |
| 166 | 170 |
| 167 // True if print backgrounds is requested by the user. | 171 // True if print backgrounds is requested by the user. |
| 168 IPC_STRUCT_TRAITS_MEMBER(should_print_backgrounds) | 172 IPC_STRUCT_TRAITS_MEMBER(should_print_backgrounds) |
| 173 |
| 174 // The document type of printed page(s) from render. |
| 175 IPC_STRUCT_TRAITS_MEMBER(printed_doc_type) |
| 169 IPC_STRUCT_TRAITS_END() | 176 IPC_STRUCT_TRAITS_END() |
| 170 | 177 |
| 171 IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) | 178 IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) |
| 172 IPC_STRUCT_TRAITS_MEMBER(from) | 179 IPC_STRUCT_TRAITS_MEMBER(from) |
| 173 IPC_STRUCT_TRAITS_MEMBER(to) | 180 IPC_STRUCT_TRAITS_MEMBER(to) |
| 174 IPC_STRUCT_TRAITS_END() | 181 IPC_STRUCT_TRAITS_END() |
| 175 | 182 |
| 176 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 183 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 177 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) | 184 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) |
| 178 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) | 185 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 475 |
| 469 // Tell the browser to show the print preview, when the document is sufficiently | 476 // Tell the browser to show the print preview, when the document is sufficiently |
| 470 // loaded such that the renderer can determine whether it is modifiable or not. | 477 // loaded such that the renderer can determine whether it is modifiable or not. |
| 471 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, | 478 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, |
| 472 bool /* is_modifiable */) | 479 bool /* is_modifiable */) |
| 473 | 480 |
| 474 // Notify the browser to set print presets based on source PDF document. | 481 // Notify the browser to set print presets based on source PDF document. |
| 475 IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, | 482 IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, |
| 476 PrintHostMsg_SetOptionsFromDocument_Params /* params */) | 483 PrintHostMsg_SetOptionsFromDocument_Params /* params */) |
| 477 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) | 484 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| OLD | NEW |