| 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/values.h" | 11 #include "base/values.h" |
| 12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
| 13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
| 14 #include "printing/page_size_margins.h" | 14 #include "printing/page_size_margins.h" |
| 15 #include "printing/print_job_constants.h" | 15 #include "printing/print_job_constants.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintScalingOption
.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintScalingOption
.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 18 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
| 19 | 19 |
| 20 #ifndef CHROME_COMMON_PRINT_MESSAGES_H_ | 20 #ifndef CHROME_COMMON_PRINT_MESSAGES_H_ |
| 21 #define CHROME_COMMON_PRINT_MESSAGES_H_ | 21 #define CHROME_COMMON_PRINT_MESSAGES_H_ |
| 22 | 22 |
| 23 struct PrintMsg_Print_Params { | 23 struct PrintMsg_Print_Params { |
| 24 PrintMsg_Print_Params(); | 24 PrintMsg_Print_Params(); |
| 25 ~PrintMsg_Print_Params(); | 25 ~PrintMsg_Print_Params(); |
| 26 | 26 |
| 27 enum PrintRasterType { |
| 28 RASTER_NONE, |
| 29 RASTER_PLUGINS, |
| 30 RASTER_ALL, |
| 31 }; |
| 32 |
| 27 // Resets the members of the struct to 0. | 33 // Resets the members of the struct to 0. |
| 28 void Reset(); | 34 void Reset(); |
| 29 | 35 |
| 30 gfx::Size page_size; | 36 gfx::Size page_size; |
| 31 gfx::Size content_size; | 37 gfx::Size content_size; |
| 32 gfx::Rect printable_area; | 38 gfx::Rect printable_area; |
| 33 int margin_top; | 39 int margin_top; |
| 34 int margin_left; | 40 int margin_left; |
| 35 double dpi; | 41 double dpi; |
| 36 double min_shrink; | 42 double min_shrink; |
| 37 double max_shrink; | 43 double max_shrink; |
| 38 int desired_dpi; | 44 int desired_dpi; |
| 39 int document_cookie; | 45 int document_cookie; |
| 40 bool selection_only; | 46 bool selection_only; |
| 41 bool supports_alpha_blend; | 47 bool supports_alpha_blend; |
| 42 std::string preview_ui_addr; | 48 std::string preview_ui_addr; |
| 43 int preview_request_id; | 49 int preview_request_id; |
| 44 bool is_first_request; | 50 bool is_first_request; |
| 45 WebKit::WebPrintScalingOption print_scaling_option; | 51 WebKit::WebPrintScalingOption print_scaling_option; |
| 46 bool print_to_pdf; | 52 bool print_to_pdf; |
| 47 bool display_header_footer; | 53 bool display_header_footer; |
| 48 string16 date; | 54 string16 date; |
| 49 string16 title; | 55 string16 title; |
| 50 string16 url; | 56 string16 url; |
| 57 PrintRasterType raster_type; |
| 58 int raster_size; |
| 51 }; | 59 }; |
| 52 | 60 |
| 53 struct PrintMsg_PrintPages_Params { | 61 struct PrintMsg_PrintPages_Params { |
| 54 PrintMsg_PrintPages_Params(); | 62 PrintMsg_PrintPages_Params(); |
| 55 ~PrintMsg_PrintPages_Params(); | 63 ~PrintMsg_PrintPages_Params(); |
| 56 | 64 |
| 57 // Resets the members of the struct to 0. | 65 // Resets the members of the struct to 0. |
| 58 void Reset(); | 66 void Reset(); |
| 59 | 67 |
| 60 PrintMsg_Print_Params params; | 68 PrintMsg_Print_Params params; |
| 61 std::vector<int> pages; | 69 std::vector<int> pages; |
| 62 }; | 70 }; |
| 63 | 71 |
| 64 #endif // CHROME_COMMON_PRINT_MESSAGES_H_ | 72 #endif // CHROME_COMMON_PRINT_MESSAGES_H_ |
| 65 | 73 |
| 66 #define IPC_MESSAGE_START PrintMsgStart | 74 #define IPC_MESSAGE_START PrintMsgStart |
| 67 | 75 |
| 68 IPC_ENUM_TRAITS(printing::MarginType) | 76 IPC_ENUM_TRAITS(printing::MarginType) |
| 77 IPC_ENUM_TRAITS(PrintMsg_Print_Params::PrintRasterType) |
| 69 IPC_ENUM_TRAITS(WebKit::WebPrintScalingOption) | 78 IPC_ENUM_TRAITS(WebKit::WebPrintScalingOption) |
| 70 | 79 |
| 71 // Parameters for a render request. | 80 // Parameters for a render request. |
| 72 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) | 81 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) |
| 73 // Physical size of the page, including non-printable margins, | 82 // Physical size of the page, including non-printable margins, |
| 74 // in pixels according to dpi. | 83 // in pixels according to dpi. |
| 75 IPC_STRUCT_TRAITS_MEMBER(page_size) | 84 IPC_STRUCT_TRAITS_MEMBER(page_size) |
| 76 | 85 |
| 77 // In pixels according to dpi_x and dpi_y. | 86 // In pixels according to dpi_x and dpi_y. |
| 78 IPC_STRUCT_TRAITS_MEMBER(content_size) | 87 IPC_STRUCT_TRAITS_MEMBER(content_size) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 IPC_STRUCT_TRAITS_MEMBER(display_header_footer) | 137 IPC_STRUCT_TRAITS_MEMBER(display_header_footer) |
| 129 | 138 |
| 130 // Date string to be printed as header if requested by the user. | 139 // Date string to be printed as header if requested by the user. |
| 131 IPC_STRUCT_TRAITS_MEMBER(date) | 140 IPC_STRUCT_TRAITS_MEMBER(date) |
| 132 | 141 |
| 133 // Title string to be printed as header if requested by the user. | 142 // Title string to be printed as header if requested by the user. |
| 134 IPC_STRUCT_TRAITS_MEMBER(title) | 143 IPC_STRUCT_TRAITS_MEMBER(title) |
| 135 | 144 |
| 136 // URL string to be printed as footer if requested by the user. | 145 // URL string to be printed as footer if requested by the user. |
| 137 IPC_STRUCT_TRAITS_MEMBER(url) | 146 IPC_STRUCT_TRAITS_MEMBER(url) |
| 147 |
| 148 // Type of documents to be converted to raster for printing. |
| 149 IPC_STRUCT_TRAITS_MEMBER(raster_type) |
| 150 |
| 151 // Size of raster in pixels. |
| 152 IPC_STRUCT_TRAITS_MEMBER(raster_size) |
| 138 IPC_STRUCT_TRAITS_END() | 153 IPC_STRUCT_TRAITS_END() |
| 139 | 154 |
| 140 IPC_STRUCT_BEGIN(PrintMsg_PrintPage_Params) | 155 IPC_STRUCT_BEGIN(PrintMsg_PrintPage_Params) |
| 141 // Parameters to render the page as a printed page. It must always be the same | 156 // Parameters to render the page as a printed page. It must always be the same |
| 142 // value for all the document. | 157 // value for all the document. |
| 143 IPC_STRUCT_MEMBER(PrintMsg_Print_Params, params) | 158 IPC_STRUCT_MEMBER(PrintMsg_Print_Params, params) |
| 144 | 159 |
| 145 // The page number is the indicator of the square that should be rendered | 160 // The page number is the indicator of the square that should be rendered |
| 146 // according to the layout specified in PrintMsg_Print_Params. | 161 // according to the layout specified in PrintMsg_Print_Params. |
| 147 IPC_STRUCT_MEMBER(int, page_number) | 162 IPC_STRUCT_MEMBER(int, page_number) |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 int /* document cookie */) | 430 int /* document cookie */) |
| 416 | 431 |
| 417 // Run a nested message loop in the renderer until print preview for | 432 // Run a nested message loop in the renderer until print preview for |
| 418 // window.print() finishes. | 433 // window.print() finishes. |
| 419 IPC_SYNC_MESSAGE_ROUTED1_0(PrintHostMsg_ScriptedPrintPreview, | 434 IPC_SYNC_MESSAGE_ROUTED1_0(PrintHostMsg_ScriptedPrintPreview, |
| 420 bool /* is_modifiable */) | 435 bool /* is_modifiable */) |
| 421 | 436 |
| 422 // Notify the browser that the PDF in the initiator renderer has disabled print | 437 // Notify the browser that the PDF in the initiator renderer has disabled print |
| 423 // scaling option. | 438 // scaling option. |
| 424 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) | 439 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) |
| OLD | NEW |