refactor: printToPDF should be headless (#33654)

This commit is contained in:
Shelley Vohr 2022-05-31 08:21:25 +02:00 committed by GitHub
parent 0d69067dee
commit 93b39b92b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 648 additions and 414 deletions

View file

@ -47,7 +47,6 @@
#include "ui/gfx/image/image.h"
#if BUILDFLAG(ENABLE_PRINTING)
#include "shell/browser/printing/print_preview_message_handler.h"
#include "shell/browser/printing/print_view_manager_electron.h"
#endif
@ -231,7 +230,10 @@ class WebContents : public ExclusiveAccessContext,
std::pair<std::string, std::u16string> info);
void Print(gin::Arguments* args);
// Print current page as PDF.
v8::Local<v8::Promise> PrintToPDF(base::DictionaryValue settings);
v8::Local<v8::Promise> PrintToPDF(const base::Value& settings);
void OnPDFCreated(gin_helper::Promise<v8::Local<v8::Value>> promise,
PrintViewManagerElectron::PrintResult print_result,
scoped_refptr<base::RefCountedMemory> data);
#endif
void SetNextChildWebPreferences(const gin_helper::Dictionary);