refactor: options parsing in WebContents.prototype.printToPDF() (#40257)

* refactor: options parsing in WebContents.prototype.printToPDF()

* tweak parsePageSize
This commit is contained in:
Milan Burda 2023-10-19 21:38:30 +02:00 committed by GitHub
parent 025af3500c
commit beb0cbc6d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 141 deletions

View file

@ -3116,8 +3116,7 @@ v8::Local<v8::Promise> WebContents::PrintToPDF(const base::Value& settings) {
auto header_template = *settings.GetDict().FindString("headerTemplate");
auto footer_template = *settings.GetDict().FindString("footerTemplate");
auto prefer_css_page_size = settings.GetDict().FindBool("preferCSSPageSize");
auto generate_tagged_pdf =
settings.GetDict().FindBool("shouldGenerateTaggedPDF");
auto generate_tagged_pdf = settings.GetDict().FindBool("generateTaggedPDF");
absl::variant<printing::mojom::PrintPagesParamsPtr, std::string>
print_pages_params = print_to_pdf::GetPrintPagesParams(