Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: chrome/common/print_messages.h

Issue 388783003: Add support to send print preset options in one message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for Android trybot failure Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/chrome_utility_printing_messages.h ('k') | chrome/common/print_messages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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();
77 ~PrintHostMsg_SetOptionsFromDocument_Params();
78
79 bool is_scaling_disabled;
80 int copies;
81 printing::DuplexMode duplex;
82 printing::PageRanges page_ranges;
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_MIN_MAX_VALUE(printing::DuplexMode,
94 printing::UNKNOWN_DUPLEX_MODE,
95 printing::SHORT_EDGE)
82 96
83 // Parameters for a render request. 97 // Parameters for a render request.
84 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) 98 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params)
85 // Physical size of the page, including non-printable margins, 99 // Physical size of the page, including non-printable margins,
86 // in pixels according to dpi. 100 // in pixels according to dpi.
87 IPC_STRUCT_TRAITS_MEMBER(page_size) 101 IPC_STRUCT_TRAITS_MEMBER(page_size)
88 102
89 // In pixels according to dpi_x and dpi_y. 103 // In pixels according to dpi_x and dpi_y.
90 IPC_STRUCT_TRAITS_MEMBER(content_size) 104 IPC_STRUCT_TRAITS_MEMBER(content_size)
91 105
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 IPC_STRUCT_MEMBER(int, page_number) 173 IPC_STRUCT_MEMBER(int, page_number)
160 IPC_STRUCT_END() 174 IPC_STRUCT_END()
161 175
162 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) 176 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
163 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) 177 IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
164 IPC_STRUCT_TRAITS_MEMBER(webnode_only) 178 IPC_STRUCT_TRAITS_MEMBER(webnode_only)
165 IPC_STRUCT_TRAITS_MEMBER(has_selection) 179 IPC_STRUCT_TRAITS_MEMBER(has_selection)
166 IPC_STRUCT_TRAITS_MEMBER(selection_only) 180 IPC_STRUCT_TRAITS_MEMBER(selection_only)
167 IPC_STRUCT_TRAITS_END() 181 IPC_STRUCT_TRAITS_END()
168 182
183 IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
184 IPC_STRUCT_TRAITS_MEMBER(from)
185 IPC_STRUCT_TRAITS_MEMBER(to)
186 IPC_STRUCT_TRAITS_END()
187
188 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
189 // Specifies whether print scaling is enabled or not.
190 IPC_STRUCT_TRAITS_MEMBER(is_scaling_disabled)
191
192 // Specifies number of copies to be printed.
193 IPC_STRUCT_TRAITS_MEMBER(copies)
194
195 // Specifies paper handling option.
196 IPC_STRUCT_TRAITS_MEMBER(duplex)
197
198 // Specifies page range to be printed.
199 IPC_STRUCT_TRAITS_MEMBER(page_ranges)
200 IPC_STRUCT_TRAITS_END()
201
169 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) 202 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
170 IPC_STRUCT_TRAITS_MEMBER(content_width) 203 IPC_STRUCT_TRAITS_MEMBER(content_width)
171 IPC_STRUCT_TRAITS_MEMBER(content_height) 204 IPC_STRUCT_TRAITS_MEMBER(content_height)
172 IPC_STRUCT_TRAITS_MEMBER(margin_left) 205 IPC_STRUCT_TRAITS_MEMBER(margin_left)
173 IPC_STRUCT_TRAITS_MEMBER(margin_right) 206 IPC_STRUCT_TRAITS_MEMBER(margin_right)
174 IPC_STRUCT_TRAITS_MEMBER(margin_top) 207 IPC_STRUCT_TRAITS_MEMBER(margin_top)
175 IPC_STRUCT_TRAITS_MEMBER(margin_bottom) 208 IPC_STRUCT_TRAITS_MEMBER(margin_bottom)
176 IPC_STRUCT_TRAITS_END() 209 IPC_STRUCT_TRAITS_END()
177 210
178 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) 211 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 469
437 // Run a nested message loop in the renderer until print preview for 470 // Run a nested message loop in the renderer until print preview for
438 // window.print() finishes. 471 // window.print() finishes.
439 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) 472 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview)
440 473
441 // Tell the browser to show the print preview, when the document is sufficiently 474 // 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. 475 // loaded such that the renderer can determine whether it is modifiable or not.
443 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, 476 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
444 bool /* is_modifiable */) 477 bool /* is_modifiable */)
445 478
446 // Notify the browser that the PDF in the initiator renderer has disabled print 479 // Notify the browser to set print presets based on source PDF document.
447 // scaling option. 480 IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
448 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) 481 PrintHostMsg_SetOptionsFromDocument_Params /* params */)
OLDNEW
« no previous file with comments | « chrome/common/chrome_utility_printing_messages.h ('k') | chrome/common/print_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698