mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update source files for bracket style
This commit is contained in:
@@ -35,8 +35,9 @@ namespace {
|
||||
CefRefPtr<CefBrowserHostBase> GetBrowserForContext(
|
||||
printing::PrintingContextLinux* context) {
|
||||
// The print preview dialog won't have a valid child ID.
|
||||
if (!frame_util::IsValidChildId(context->render_process_id()))
|
||||
if (!frame_util::IsValidChildId(context->render_process_id())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return extensions::GetOwnerBrowserForGlobalId(
|
||||
frame_util::MakeGlobalId(context->render_process_id(),
|
||||
@@ -264,8 +265,9 @@ void CefPrintDialogLinux::PrintDocument(
|
||||
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
|
||||
success = metafile.SaveTo(&file);
|
||||
file.Close();
|
||||
if (!success)
|
||||
if (!success) {
|
||||
base::DeleteFile(path_to_pdf_);
|
||||
}
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
|
@@ -69,10 +69,12 @@ void PrintToPDF(content::WebContents* web_contents,
|
||||
// Defaults to no header/footer.
|
||||
absl::optional<std::string> header_template, footer_template;
|
||||
if (display_header_footer) {
|
||||
if (settings.header_template.length > 0)
|
||||
if (settings.header_template.length > 0) {
|
||||
header_template = CefString(&settings.header_template);
|
||||
if (settings.footer_template.length > 0)
|
||||
}
|
||||
if (settings.footer_template.length > 0) {
|
||||
footer_template = CefString(&settings.footer_template);
|
||||
}
|
||||
}
|
||||
|
||||
// Defaults to 1.0.
|
||||
@@ -96,14 +98,18 @@ void PrintToPDF(content::WebContents* web_contents,
|
||||
margin_left = 0;
|
||||
margin_right = 0;
|
||||
} else if (settings.margin_type == PDF_PRINT_MARGIN_CUSTOM) {
|
||||
if (settings.margin_top >= 0)
|
||||
if (settings.margin_top >= 0) {
|
||||
margin_top = settings.margin_top;
|
||||
if (settings.margin_bottom >= 0)
|
||||
}
|
||||
if (settings.margin_bottom >= 0) {
|
||||
margin_bottom = settings.margin_bottom;
|
||||
if (settings.margin_left >= 0)
|
||||
}
|
||||
if (settings.margin_left >= 0) {
|
||||
margin_left = settings.margin_left;
|
||||
if (settings.margin_right >= 0)
|
||||
}
|
||||
if (settings.margin_right >= 0) {
|
||||
margin_right = settings.margin_right;
|
||||
}
|
||||
}
|
||||
|
||||
absl::variant<printing::mojom::PrintPagesParamsPtr, std::string>
|
||||
|
Reference in New Issue
Block a user