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

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: Review feedback (update param structure) 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
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)
Vitaly Buka (NO REVIEWS) 2014/07/15 23:08:39 Needs IPC_ENUM_TRAITS_MAX_VALUE(printing::DuplexMo
Nikhil 2014/07/16 08:16:52 Done.
Nikhil 2014/07/16 09:26:57 Removed the change from this patch. I'll check mor
Nikhil 2014/07/16 10:25:06 The range for printing::DuplexMode seems to be alr
80 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPrintScalingOption, 91 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPrintScalingOption,
81 blink::WebPrintScalingOptionLast) 92 blink::WebPrintScalingOptionLast)
82 93
83 // Parameters for a render request. 94 // Parameters for a render request.
84 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) 95 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params)
85 // Physical size of the page, including non-printable margins, 96 // Physical size of the page, including non-printable margins,
86 // in pixels according to dpi. 97 // in pixels according to dpi.
87 IPC_STRUCT_TRAITS_MEMBER(page_size) 98 IPC_STRUCT_TRAITS_MEMBER(page_size)
88 99
89 // In pixels according to dpi_x and dpi_y. 100 // In pixels according to dpi_x and dpi_y.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 IPC_STRUCT_MEMBER(int, page_number) 170 IPC_STRUCT_MEMBER(int, page_number)
160 IPC_STRUCT_END() 171 IPC_STRUCT_END()
161 172
162 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) 173 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
163 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) 174 IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
164 IPC_STRUCT_TRAITS_MEMBER(webnode_only) 175 IPC_STRUCT_TRAITS_MEMBER(webnode_only)
165 IPC_STRUCT_TRAITS_MEMBER(has_selection) 176 IPC_STRUCT_TRAITS_MEMBER(has_selection)
166 IPC_STRUCT_TRAITS_MEMBER(selection_only) 177 IPC_STRUCT_TRAITS_MEMBER(selection_only)
167 IPC_STRUCT_TRAITS_END() 178 IPC_STRUCT_TRAITS_END()
168 179
180 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
181 // Specifies whether print scaling is enabled or not.
182 IPC_STRUCT_TRAITS_MEMBER(is_scaling_disabled)
183
184 // Specifies number of copies to be printed.
185 IPC_STRUCT_TRAITS_MEMBER(copies)
186
187 // Specifies paper handling option.
188 IPC_STRUCT_TRAITS_MEMBER(duplex)
189
190 // Specifies page range to be printed.
191 IPC_STRUCT_TRAITS_MEMBER(page_ranges)
192 IPC_STRUCT_TRAITS_END()
193
169 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) 194 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
170 IPC_STRUCT_TRAITS_MEMBER(content_width) 195 IPC_STRUCT_TRAITS_MEMBER(content_width)
171 IPC_STRUCT_TRAITS_MEMBER(content_height) 196 IPC_STRUCT_TRAITS_MEMBER(content_height)
172 IPC_STRUCT_TRAITS_MEMBER(margin_left) 197 IPC_STRUCT_TRAITS_MEMBER(margin_left)
173 IPC_STRUCT_TRAITS_MEMBER(margin_right) 198 IPC_STRUCT_TRAITS_MEMBER(margin_right)
174 IPC_STRUCT_TRAITS_MEMBER(margin_top) 199 IPC_STRUCT_TRAITS_MEMBER(margin_top)
175 IPC_STRUCT_TRAITS_MEMBER(margin_bottom) 200 IPC_STRUCT_TRAITS_MEMBER(margin_bottom)
176 IPC_STRUCT_TRAITS_END() 201 IPC_STRUCT_TRAITS_END()
177 202
178 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) 203 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 461
437 // Run a nested message loop in the renderer until print preview for 462 // Run a nested message loop in the renderer until print preview for
438 // window.print() finishes. 463 // window.print() finishes.
439 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) 464 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview)
440 465
441 // Tell the browser to show the print preview, when the document is sufficiently 466 // 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. 467 // loaded such that the renderer can determine whether it is modifiable or not.
443 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, 468 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
444 bool /* is_modifiable */) 469 bool /* is_modifiable */)
445 470
446 // Notify the browser that the PDF in the initiator renderer has disabled print 471 // Notify the browser to set print presets based on source PDF document.
447 // scaling option. 472 IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
448 IPC_MESSAGE_ROUTED0(PrintHostMsg_PrintPreviewScalingDisabled) 473 PrintHostMsg_SetOptionsFromDocument_Params /* params */)
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_ui.cc ('k') | chrome/common/print_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698