mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: use newly mojo-ified PrintPreviewFailed
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2195343 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
committed by
deepak1556
parent
cc76bbdd5c
commit
de074ce23a
@@ -133,12 +133,11 @@ void PrintPreviewMessageHandler::OnCompositePdfDocumentDone(
|
||||
base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(region));
|
||||
}
|
||||
|
||||
void PrintPreviewMessageHandler::OnPrintPreviewFailed(
|
||||
int document_cookie,
|
||||
const PrintHostMsg_PreviewIds& ids) {
|
||||
void PrintPreviewMessageHandler::PrintPreviewFailed(int32_t document_cookie,
|
||||
int32_t request_id) {
|
||||
StopWorker(document_cookie);
|
||||
|
||||
RejectPromise(ids.request_id);
|
||||
RejectPromise(request_id);
|
||||
}
|
||||
|
||||
void PrintPreviewMessageHandler::OnPrintPreviewCancelled(
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace electron {
|
||||
// Manages the print preview handling for a WebContents.
|
||||
class PrintPreviewMessageHandler
|
||||
: public content::WebContentsObserver,
|
||||
public printing::mojom::PrintPreviewUI,
|
||||
public content::WebContentsUserData<PrintPreviewMessageHandler> {
|
||||
public:
|
||||
~PrintPreviewMessageHandler() override;
|
||||
@@ -54,11 +55,15 @@ class PrintPreviewMessageHandler
|
||||
const PrintHostMsg_PreviewIds& ids,
|
||||
printing::mojom::PrintCompositor::Status status,
|
||||
base::ReadOnlySharedMemoryRegion region);
|
||||
void OnPrintPreviewFailed(int document_cookie,
|
||||
const PrintHostMsg_PreviewIds& ids);
|
||||
void OnPrintPreviewCancelled(int document_cookie,
|
||||
const PrintHostMsg_PreviewIds& ids);
|
||||
|
||||
// printing::mojo::PrintPreviewUI:
|
||||
void SetOptionsFromDocument(
|
||||
const printing::mojom::OptionsFromDocumentParamsPtr params,
|
||||
int32_t request_id) override {}
|
||||
void PrintPreviewFailed(int32_t document_cookie, int32_t request_id) override;
|
||||
|
||||
gin_helper::Promise<v8::Local<v8::Value>> GetPromise(int request_id);
|
||||
|
||||
void ResolvePromise(int request_id,
|
||||
|
||||
Reference in New Issue
Block a user