-
Kent Tamura authored
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#printing * Blink Add empty implementation of WebLocalFrame::DispatchBeforePrintEvent() and DispatchAfterPrintEvent(). They should be called before and after pairs of PrintBegin() and PrintEnd(). Note that we usually calls a pair of PrintBegin() and PrintEnd() multiple times to print a page. So we shouldn't dispatch beforeprint/ afterprint events in PrintBegin() and PrintEnd(). * For PRINT_PREVIEW PrintRenderFrameHelper::RequestPrintPreview() calls DispatchBeforePrintEvent(). Add a new message to tell that print preview dialog is closed, and its message handler calls DispatchAfterPrintEvent(). If "Print using system dialog..." in the preview dialog is clicked, we don't send the message. This CL introduces new field is_switching_to_system_dialog_ to PrintViewManager, and we send the message in PrintViewManager::PrintPreviewDone() only if the flag is false. PrintRenderFrameHelper::OnPrintForSystemDialog() is responsible to dispatch afterprint event in this case. * For BASIC_PRINTING PrintRenderFrameHelper::OnPrintPages() and ScriptedPrint() calls DispatchBeforePrintEvent() before Print(), and DispatchAfterPrintEvent() after Print(). This CL shouldn't have any user-visible behavior changes. Bug: 218205 Change-Id: I536358441990f4afb3739ce4b3015d0e3347b11d Reviewed-on: https://chromium-review.googlesource.com/605148 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#503984}
18c99f9a