summaryrefslogtreecommitdiffstats
path: root/src/core/print_view_manager_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-02-23 17:11:05 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-03-27 09:13:09 +0000
commitbce063054682e590e9fa8aa9d2ec19ca26ea3d49 (patch)
tree72eafcf4e0d2c6518ffd38772f7f5758bf6a4137 /src/core/print_view_manager_qt.cpp
parent817c117cf89f15e1877107597c8daeff956fd1a6 (diff)
Adaptations for Chromium 56
Change-Id: I78240d7956de4716757761fc6517f031b4adb822 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/print_view_manager_qt.cpp')
-rw-r--r--src/core/print_view_manager_qt.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/print_view_manager_qt.cpp b/src/core/print_view_manager_qt.cpp
index 6006c3bad..8a43cc419 100644
--- a/src/core/print_view_manager_qt.cpp
+++ b/src/core/print_view_manager_qt.cpp
@@ -53,6 +53,7 @@
#include "components/printing/common/print_messages.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/common/web_preferences.h"
#include "printing/pdf_metafile_skia.h"
#include "printing/print_job_constants.h"
@@ -137,6 +138,7 @@ static base::DictionaryValue *createPrintSettings()
printSettings->SetBoolean(printing::kSettingShouldPrintSelectionOnly, false);
printSettings->SetBoolean(printing::kSettingShouldPrintBackgrounds, true);
printSettings->SetBoolean(printing::kSettingHeaderFooterEnabled, false);
+ printSettings->SetInteger(printing::kSettingScaleFactor, 100);
printSettings->SetString(printing::kSettingDeviceName, "");
printSettings->SetInteger(printing::kPreviewUIID, 12345678);
@@ -178,7 +180,7 @@ PrintViewManagerQt::~PrintViewManagerQt()
{
}
-#if defined(ENABLE_BASIC_PRINTING)
+#if BUILDFLAG(ENABLE_BASIC_PRINTING)
void PrintViewManagerQt::PrintToPDFFileWithCallback(const QPageLayout &pageLayout,
bool printInColor, const QString &filePath,
const PrintToPDFFileCallback& callback)
@@ -238,10 +240,11 @@ bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout, bool
, web_contents()->GetRenderViewHost()->GetWebkitPreferences().should_print_backgrounds);
m_printSettings->SetInteger(printing::kSettingColor,
printInColor ? printing::COLOR : printing::GRAYSCALE);
- return Send(new PrintMsg_InitiatePrintPreview(routing_id(), false));
+ return Send(new PrintMsg_InitiatePrintPreview(
+ web_contents()->GetMainFrame()->GetRoutingID(), false));
}
-#endif // defined(ENABLE_BASIC_PRINTING)
+#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
// PrintedPagesSource implementation.
base::string16 PrintViewManagerQt::RenderSourceName()
@@ -256,7 +259,7 @@ PrintViewManagerQt::PrintViewManagerQt(content::WebContents *contents)
}
// content::WebContentsObserver implementation.
-bool PrintViewManagerQt::OnMessageReceived(const IPC::Message& message)
+bool PrintViewManagerQt::OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* render_frame_host)
{
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PrintViewManagerQt, message)
@@ -267,7 +270,7 @@ bool PrintViewManagerQt::OnMessageReceived(const IPC::Message& message)
OnMetafileReadyForPrinting);
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
- return handled || PrintManager::OnMessageReceived(message);
+ return handled || PrintManager::OnMessageReceived(message, render_frame_host);
}
void PrintViewManagerQt::resetPdfState()
@@ -283,7 +286,8 @@ void PrintViewManagerQt::resetPdfState()
void PrintViewManagerQt::OnRequestPrintPreview(
const PrintHostMsg_RequestPrintPreview_Params& params)
{
- Send(new PrintMsg_PrintPreview(routing_id(), *m_printSettings));
+ Send(new PrintMsg_PrintPreview(
+ web_contents()->GetMainFrame()->GetRoutingID(), *m_printSettings));
}
void PrintViewManagerQt::OnMetafileReadyForPrinting(