From aa29bf8019571205989623f9a129b2d89b40b575 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 18 May 2017 10:26:22 -0700 Subject: [PATCH] :art: --- atom/browser/api/atom_api_web_contents.cc | 24 +++++++++---------- atom/browser/api/atom_api_web_contents.h | 2 +- .../printing/print_view_manager_base.h | 2 +- .../printing/printing_message_filter.cc | 3 +-- .../printing/printing_message_filter.h | 2 +- .../printing/print_web_view_helper.cc | 3 ++- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 56a3ab3d90e..df0334f12b6 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -140,16 +140,16 @@ struct Converter { template<> struct Converter { - static v8::Local - ToV8(v8::Isolate* isolate, const printing::PrinterBasicInfo& val) { - mate::Dictionary dict(isolate, v8::Object::New(isolate)); - dict.Set("name", val.printer_name); - dict.Set("description", val.printer_description); - dict.Set("status", val.printer_status); - dict.Set("isDefault", val.is_default); - dict.Set("options", val.options); - return dict.GetHandle(); - } + static v8::Local ToV8(v8::Isolate* isolate, + const printing::PrinterBasicInfo& val) { + mate::Dictionary dict(isolate, v8::Object::New(isolate)); + dict.Set("name", val.printer_name); + dict.Set("description", val.printer_description); + dict.Set("status", val.printer_status); + dict.Set("isDefault", val.is_default); + dict.Set("options", val.options); + return dict.GetHandle(); + } }; template<> @@ -1322,9 +1322,7 @@ void WebContents::Print(mate::Arguments* args) { settings.device_name); } - -std::vector WebContents::GetPrinterList( - mate::Arguments* args) { +std::vector WebContents::GetPrinterList() { std::vector printers; auto print_backend = printing::PrintBackend::CreateInstance(nullptr); print_backend->EnumeratePrinters(&printers); diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 4bb3b2c0894..6a04d6f518c 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -122,7 +122,7 @@ class WebContents : public mate::TrackableObject, void SetAudioMuted(bool muted); bool IsAudioMuted(); void Print(mate::Arguments* args); - std::vector GetPrinterList(mate::Arguments* args); + std::vector GetPrinterList(); void SetEmbedder(const WebContents* embedder); // Print current page as PDF. diff --git a/chromium_src/chrome/browser/printing/print_view_manager_base.h b/chromium_src/chrome/browser/printing/print_view_manager_base.h index 7e5c33b09c1..61f42382bd4 100644 --- a/chromium_src/chrome/browser/printing/print_view_manager_base.h +++ b/chromium_src/chrome/browser/printing/print_view_manager_base.h @@ -41,7 +41,7 @@ class PrintViewManagerBase : public content::NotificationObserver, // this function. Returns false if printing is impossible at the moment. virtual bool PrintNow(content::RenderFrameHost* rfh, bool silent, bool print_background, - const base::string16&); + const base::string16& device_name); #endif // !DISABLE_BASIC_PRINTING // PrintedPagesSource implementation. diff --git a/chromium_src/chrome/browser/printing/printing_message_filter.cc b/chromium_src/chrome/browser/printing/printing_message_filter.cc index b028818da9d..1c9e9daadef 100644 --- a/chromium_src/chrome/browser/printing/printing_message_filter.cc +++ b/chromium_src/chrome/browser/printing/printing_message_filter.cc @@ -116,9 +116,8 @@ bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) { #endif IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_GetDefaultPrintSettings, OnGetDefaultPrintSettings) - IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_InitSettingWithDeviceName, - OnInitSettingWithDeviceName) + OnInitSettingWithDeviceName) IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_ScriptedPrint, OnScriptedPrint) IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_UpdatePrintSettings, OnUpdatePrintSettings) diff --git a/chromium_src/chrome/browser/printing/printing_message_filter.h b/chromium_src/chrome/browser/printing/printing_message_filter.h index a4f4efba817..fb7dced52e4 100644 --- a/chromium_src/chrome/browser/printing/printing_message_filter.h +++ b/chromium_src/chrome/browser/printing/printing_message_filter.h @@ -64,7 +64,7 @@ class PrintingMessageFilter : public content::BrowserMessageFilter { // Set deviceName void OnInitSettingWithDeviceName(const base::string16& device_name, - IPC::Message* reply_msg); + IPC::Message* reply_msg); void OnGetDefaultPrintSettingsReply(scoped_refptr printer_query, IPC::Message* reply_msg); diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc index 939dc13711d..4014b3fa0ed 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc @@ -1026,7 +1026,8 @@ bool PrintWebViewHelper::InitPrintSettings(bool fit_to_paper_size, } bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, - const blink::WebNode& node, int* number_of_pages, + const blink::WebNode& node, + int* number_of_pages, const base::string16& device_name) { DCHECK(frame); bool fit_to_paper_size = !(PrintingNodeOrPdfFrame(frame, node));