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

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

Issue 8585017: PrintPreview: Honor the print media page size and margin values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added one more test Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/print_preview_ui.cc ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 10 matching lines...) Expand all
21 21
22 struct PrintMsg_Print_Params { 22 struct PrintMsg_Print_Params {
23 PrintMsg_Print_Params(); 23 PrintMsg_Print_Params();
24 ~PrintMsg_Print_Params(); 24 ~PrintMsg_Print_Params();
25 25
26 // Resets the members of the struct to 0. 26 // Resets the members of the struct to 0.
27 void Reset(); 27 void Reset();
28 28
29 gfx::Size page_size; 29 gfx::Size page_size;
30 gfx::Size content_size; 30 gfx::Size content_size;
31 gfx::Rect printable_area;
31 int margin_top; 32 int margin_top;
32 int margin_left; 33 int margin_left;
33 double dpi; 34 double dpi;
34 double min_shrink; 35 double min_shrink;
35 double max_shrink; 36 double max_shrink;
36 int desired_dpi; 37 int desired_dpi;
37 int document_cookie; 38 int document_cookie;
38 bool selection_only; 39 bool selection_only;
39 bool supports_alpha_blend; 40 bool supports_alpha_blend;
40 std::string preview_ui_addr; 41 std::string preview_ui_addr;
41 int preview_request_id; 42 int preview_request_id;
42 bool is_first_request; 43 bool is_first_request;
44 bool print_to_pdf;
43 bool display_header_footer; 45 bool display_header_footer;
44 string16 date; 46 string16 date;
45 string16 title; 47 string16 title;
46 string16 url; 48 string16 url;
47 }; 49 };
48 50
49 struct PrintMsg_PrintPages_Params { 51 struct PrintMsg_PrintPages_Params {
50 PrintMsg_PrintPages_Params(); 52 PrintMsg_PrintPages_Params();
51 ~PrintMsg_PrintPages_Params(); 53 ~PrintMsg_PrintPages_Params();
52 54
(...skipping 12 matching lines...) Expand all
65 67
66 // Parameters for a render request. 68 // Parameters for a render request.
67 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) 69 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params)
68 // Physical size of the page, including non-printable margins, 70 // Physical size of the page, including non-printable margins,
69 // in pixels according to dpi. 71 // in pixels according to dpi.
70 IPC_STRUCT_TRAITS_MEMBER(page_size) 72 IPC_STRUCT_TRAITS_MEMBER(page_size)
71 73
72 // In pixels according to dpi_x and dpi_y. 74 // In pixels according to dpi_x and dpi_y.
73 IPC_STRUCT_TRAITS_MEMBER(content_size) 75 IPC_STRUCT_TRAITS_MEMBER(content_size)
74 76
77 // Physical printable area of the page in pixels according to dpi.
78 IPC_STRUCT_TRAITS_MEMBER(printable_area)
79
75 // The y-offset of the printable area, in pixels according to dpi. 80 // The y-offset of the printable area, in pixels according to dpi.
76 IPC_STRUCT_TRAITS_MEMBER(margin_top) 81 IPC_STRUCT_TRAITS_MEMBER(margin_top)
77 82
78 // The x-offset of the printable area, in pixels according to dpi. 83 // The x-offset of the printable area, in pixels according to dpi.
79 IPC_STRUCT_TRAITS_MEMBER(margin_left) 84 IPC_STRUCT_TRAITS_MEMBER(margin_left)
80 85
81 // Specifies dots per inch. 86 // Specifies dots per inch.
82 IPC_STRUCT_TRAITS_MEMBER(dpi) 87 IPC_STRUCT_TRAITS_MEMBER(dpi)
83 88
84 // Minimum shrink factor. See PrintSettings::min_shrink for more information. 89 // Minimum shrink factor. See PrintSettings::min_shrink for more information.
(...skipping 18 matching lines...) Expand all
103 108
104 // The print preview ui associated with this request. 109 // The print preview ui associated with this request.
105 IPC_STRUCT_TRAITS_MEMBER(preview_ui_addr) 110 IPC_STRUCT_TRAITS_MEMBER(preview_ui_addr)
106 111
107 // The id of the preview request. 112 // The id of the preview request.
108 IPC_STRUCT_TRAITS_MEMBER(preview_request_id) 113 IPC_STRUCT_TRAITS_MEMBER(preview_request_id)
109 114
110 // True if this is the first preview request. 115 // True if this is the first preview request.
111 IPC_STRUCT_TRAITS_MEMBER(is_first_request) 116 IPC_STRUCT_TRAITS_MEMBER(is_first_request)
112 117
118 // True if print to pdf is requested.
119 IPC_STRUCT_TRAITS_MEMBER(print_to_pdf)
120
113 // Specifies if the header and footer should be rendered. 121 // Specifies if the header and footer should be rendered.
114 IPC_STRUCT_TRAITS_MEMBER(display_header_footer) 122 IPC_STRUCT_TRAITS_MEMBER(display_header_footer)
115 123
116 // Date string to be printed as header if requested by the user. 124 // Date string to be printed as header if requested by the user.
117 IPC_STRUCT_TRAITS_MEMBER(date) 125 IPC_STRUCT_TRAITS_MEMBER(date)
118 126
119 // Title string to be printed as header if requested by the user. 127 // Title string to be printed as header if requested by the user.
120 IPC_STRUCT_TRAITS_MEMBER(title) 128 IPC_STRUCT_TRAITS_MEMBER(title)
121 129
122 // URL string to be printed as footer if requested by the user. 130 // URL string to be printed as footer if requested by the user.
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 352
345 // Asks the browser to do print preview. 353 // Asks the browser to do print preview.
346 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, bool /* is_modifiable */) 354 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, bool /* is_modifiable */)
347 355
348 // Notify the browser the number of pages in the print preview document. 356 // Notify the browser the number of pages in the print preview document.
349 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, 357 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount,
350 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) 358 PrintHostMsg_DidGetPreviewPageCount_Params /* params */)
351 359
352 // Notify the browser of the default page layout according to the currently 360 // Notify the browser of the default page layout according to the currently
353 // selected printer and page size. 361 // selected printer and page size.
354 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetDefaultPageLayout, 362 // |has_custom_page_size_style| is true when the printing frame has a custom
355 printing::PageSizeMargins /* page layout in points */) 363 // page size css otherwise false.
364 IPC_MESSAGE_ROUTED2(PrintHostMsg_DidGetDefaultPageLayout,
365 printing::PageSizeMargins /* page layout in points */,
366 bool /* has custom page size style */)
356 367
357 // Notify the browser a print preview page has been rendered. 368 // Notify the browser a print preview page has been rendered.
358 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage, 369 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage,
359 PrintHostMsg_DidPreviewPage_Params /* params */) 370 PrintHostMsg_DidPreviewPage_Params /* params */)
360 371
361 // Asks the browser whether the print preview has been cancelled. 372 // Asks the browser whether the print preview has been cancelled.
362 IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, 373 IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
363 std::string /* print preview ui address */, 374 std::string /* print preview ui address */,
364 int /* request id */, 375 int /* request id */,
365 bool /* print preview cancelled */) 376 bool /* print preview cancelled */)
(...skipping 19 matching lines...) Expand all
385 // Tell the browser print preview found the selected printer has invalid 396 // Tell the browser print preview found the selected printer has invalid
386 // settings (which typically caused by disconnected network printer or printer 397 // settings (which typically caused by disconnected network printer or printer
387 // driver is bogus). 398 // driver is bogus).
388 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewInvalidPrinterSettings, 399 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewInvalidPrinterSettings,
389 int /* document cookie */) 400 int /* document cookie */)
390 401
391 // Run a nested message loop in the renderer until print preview for 402 // Run a nested message loop in the renderer until print preview for
392 // window.print() finishes. 403 // window.print() finishes.
393 IPC_SYNC_MESSAGE_ROUTED1_0(PrintHostMsg_ScriptedPrintPreview, 404 IPC_SYNC_MESSAGE_ROUTED1_0(PrintHostMsg_ScriptedPrintPreview,
394 bool /* is_modifiable */) 405 bool /* is_modifiable */)
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/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