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

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

Issue 7621087: Print Preview: Go from event driven print preview back to print preview with sync messages. The s... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: change print preview id, address comments, fix tests Created 9 years, 4 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
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 "base/values.h" 8 #include "base/values.h"
9 #include "base/shared_memory.h" 9 #include "base/shared_memory.h"
10 #include "ipc/ipc_message_macros.h" 10 #include "ipc/ipc_message_macros.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // Cookie for the document to ensure correctness. 43 // Cookie for the document to ensure correctness.
44 IPC_STRUCT_MEMBER(int, document_cookie) 44 IPC_STRUCT_MEMBER(int, document_cookie)
45 45
46 // Should only print currently selected text. 46 // Should only print currently selected text.
47 IPC_STRUCT_MEMBER(bool, selection_only) 47 IPC_STRUCT_MEMBER(bool, selection_only)
48 48
49 // Does the printer support alpha blending? 49 // Does the printer support alpha blending?
50 IPC_STRUCT_MEMBER(bool, supports_alpha_blend) 50 IPC_STRUCT_MEMBER(bool, supports_alpha_blend)
51 51
52 // The id of the preview request, used only for print preview. 52 // *** Parameters below are used only for print preview. ***
53
54 // The print preview ui associated with this request.
55 IPC_STRUCT_MEMBER(int, preview_ui_id)
56
57 // The id of the preview request.
53 IPC_STRUCT_MEMBER(int, preview_request_id) 58 IPC_STRUCT_MEMBER(int, preview_request_id)
54 59
55 // True if this is the first preview request, used only for print preview. 60 // True if this is the first preview request.
56 IPC_STRUCT_MEMBER(bool, is_first_request) 61 IPC_STRUCT_MEMBER(bool, is_first_request)
57 62
58 // Specifies if the header and footer should be rendered. 63 // Specifies if the header and footer should be rendered.
59 IPC_STRUCT_MEMBER(bool, display_header_footer) 64 IPC_STRUCT_MEMBER(bool, display_header_footer)
60 65
61 // Date string to be printed as header if requested by the user. 66 // Date string to be printed as header if requested by the user.
62 IPC_STRUCT_MEMBER(string16, date) 67 IPC_STRUCT_MEMBER(string16, date)
63 68
64 // Title string to be printed as header if requested by the user. 69 // Title string to be printed as header if requested by the user.
65 IPC_STRUCT_MEMBER(string16, title) 70 IPC_STRUCT_MEMBER(string16, title)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 IPC_STRUCT_END() 118 IPC_STRUCT_END()
114 119
115 // Parameters to describe a rendered preview page. 120 // Parameters to describe a rendered preview page.
116 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewPage_Params) 121 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewPage_Params)
117 // A shared memory handle to metafile data for a draft document of the page. 122 // A shared memory handle to metafile data for a draft document of the page.
118 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) 123 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle)
119 124
120 // Size of metafile data. 125 // Size of metafile data.
121 IPC_STRUCT_MEMBER(uint32, data_size) 126 IPC_STRUCT_MEMBER(uint32, data_size)
122 127
123 // |page_number| is zero-based and can be |printing::INVALID_PAGE_INDEX| if it 128 // |page_number| is zero-based.
124 // is just a check.
125 IPC_STRUCT_MEMBER(int, page_number) 129 IPC_STRUCT_MEMBER(int, page_number)
126 130
127 // The id of the preview request. 131 // The id of the preview request.
128 IPC_STRUCT_MEMBER(int, preview_request_id) 132 IPC_STRUCT_MEMBER(int, preview_request_id)
129 IPC_STRUCT_END() 133 IPC_STRUCT_END()
130 134
131 // Parameters sent along with the page count. 135 // Parameters sent along with the page count.
132 IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params) 136 IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
133 // Cookie for the document to ensure correctness. 137 // Cookie for the document to ensure correctness.
134 IPC_STRUCT_MEMBER(int, document_cookie) 138 IPC_STRUCT_MEMBER(int, document_cookie)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // called multiple times as the user updates settings. 217 // called multiple times as the user updates settings.
214 IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview, 218 IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview,
215 DictionaryValue /* settings */) 219 DictionaryValue /* settings */)
216 220
217 // Like PrintMsg_PrintPages, but using the print preview document's frame/node. 221 // Like PrintMsg_PrintPages, but using the print preview document's frame/node.
218 IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog) 222 IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog)
219 223
220 // Tells a renderer to stop blocking script initiated printing. 224 // Tells a renderer to stop blocking script initiated printing.
221 IPC_MESSAGE_ROUTED0(PrintMsg_ResetScriptedPrintCount) 225 IPC_MESSAGE_ROUTED0(PrintMsg_ResetScriptedPrintCount)
222 226
223 // Tells a renderer to continue generating the print preview.
224 // Use |requested_preview_page_index| to request a specific preview page data.
225 // |requested_preview_page_index| is 1-based or |printing::INVALID_PAGE_INDEX|
226 // to render the next page.
227 IPC_MESSAGE_ROUTED1(PrintMsg_ContinuePreview,
228 int /* requested_preview_page_index */)
229
230 // Tells a renderer to abort the print preview and reset all state.
231 IPC_MESSAGE_ROUTED0(PrintMsg_AbortPreview)
232
233 // Messages sent from the renderer to the browser. 227 // Messages sent from the renderer to the browser.
234 228
235 #if defined(OS_WIN) 229 #if defined(OS_WIN)
236 // Duplicates a shared memory handle from the renderer to the browser. Then 230 // Duplicates a shared memory handle from the renderer to the browser. Then
237 // the renderer can flush the handle. 231 // the renderer can flush the handle.
238 IPC_SYNC_MESSAGE_ROUTED1_1(PrintHostMsg_DuplicateSection, 232 IPC_SYNC_MESSAGE_ROUTED1_1(PrintHostMsg_DuplicateSection,
239 base::SharedMemoryHandle /* renderer handle */, 233 base::SharedMemoryHandle /* renderer handle */,
240 base::SharedMemoryHandle /* browser handle */) 234 base::SharedMemoryHandle /* browser handle */)
241 #endif 235 #endif
242 236
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 IPC_MESSAGE_ROUTED0(PrintHostMsg_RequestPrintPreview) 287 IPC_MESSAGE_ROUTED0(PrintHostMsg_RequestPrintPreview)
294 288
295 // Notify the browser the number of pages in the print preview document. 289 // Notify the browser the number of pages in the print preview document.
296 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, 290 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount,
297 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) 291 PrintHostMsg_DidGetPreviewPageCount_Params /* params */)
298 292
299 // Notify the browser a print preview page has been rendered. 293 // Notify the browser a print preview page has been rendered.
300 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage, 294 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage,
301 PrintHostMsg_DidPreviewPage_Params /* params */) 295 PrintHostMsg_DidPreviewPage_Params /* params */)
302 296
297 // Asks the browser whether the print preview has been cancelled,
298 // and if not, what page to render next.
299 IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
300 int /* print preview ui id */,
301 int /* request id */,
302 bool /* print preview cancelled */)
303
303 // Sends back to the browser the complete rendered document for print preview 304 // Sends back to the browser the complete rendered document for print preview
304 // that was requested by a PrintMsg_PrintPreview message. The memory handle in 305 // that was requested by a PrintMsg_PrintPreview message. The memory handle in
305 // this message is already valid in the browser process. 306 // this message is already valid in the browser process.
306 IPC_MESSAGE_ROUTED1(PrintHostMsg_PagesReadyForPreview, 307 IPC_MESSAGE_ROUTED1(PrintHostMsg_PagesReadyForPreview,
307 PrintHostMsg_DidPreviewDocument_Params /* params */) 308 PrintHostMsg_DidPreviewDocument_Params /* params */)
308 309
309 // Tell the browser printing failed. 310 // Tell the browser printing failed.
310 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, 311 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
311 int /* document cookie */) 312 int /* document cookie */)
312 313
313 // Tell the browser print preview failed. 314 // Tell the browser print preview failed.
314 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, 315 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
315 int /* document cookie */) 316 int /* document cookie */)
317
318 // Tell the browser print preview was cancelled.
319 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewCancelled,
320 int /* document cookie */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698