diff options
author | Michal Klocek <michal.klocek@qt.io> | 2018-06-15 18:51:21 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2018-07-02 10:31:10 +0000 |
commit | ec127d7e4898940116be9fbbc8dc94b4cfa9b18c (patch) | |
tree | af9dc33792e1948bdc7362925ab68f74ee9085a8 /src/core/printing | |
parent | 59b8f28d029e45ac3b3e95edda82e6607a880979 (diff) |
Migrate from BUILDFLAG to QT_CONFIG
During configuration we mapped qt webengine fetures
to chromium ones and passed them to gn. We used BUILDFLAG to
optionally compile code in core. Use QT_CONFIG directly
for qt files and add config sanity checks to make
sure requested features are present.
Change-Id: I930df114ac9aec8e73139ea9135925fc3ad8e39c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/core/printing')
-rw-r--r-- | src/core/printing/print_view_manager_base_qt.cpp | 2 | ||||
-rw-r--r-- | src/core/printing/print_view_manager_qt.cpp | 4 | ||||
-rw-r--r-- | src/core/printing/print_view_manager_qt.h | 11 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp index 51aa37f62..facc4ff84 100644 --- a/src/core/printing/print_view_manager_base_qt.cpp +++ b/src/core/printing/print_view_manager_base_qt.cpp @@ -93,7 +93,7 @@ PrintViewManagerBaseQt::~PrintViewManagerBaseQt() void PrintViewManagerBaseQt::UpdatePrintingEnabled() { bool enabled = false; -#if BUILDFLAG(ENABLE_BASIC_PRINTING) +#if QT_CONFIG(webengine_printing_and_pdf) enabled = true; #endif web_contents()->ForEachFrame( diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp index 177f4de2f..bb176d687 100644 --- a/src/core/printing/print_view_manager_qt.cpp +++ b/src/core/printing/print_view_manager_qt.cpp @@ -201,7 +201,7 @@ PrintViewManagerQt::~PrintViewManagerQt() { } -#if BUILDFLAG(ENABLE_BASIC_PRINTING) +#if QT_CONFIG(webengine_printing_and_pdf) void PrintViewManagerQt::PrintToPDFFileWithCallback(const QPageLayout &pageLayout, bool printInColor, const QString &filePath, @@ -269,7 +269,7 @@ bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout, new PrintMsg_InitiatePrintPreview(web_contents()->GetMainFrame()->GetRoutingID(), false)); } -#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) +#endif // QT_CONFIG(webengine_printing_and_pdf) // PrintedPagesSource implementation. base::string16 PrintViewManagerQt::RenderSourceName() diff --git a/src/core/printing/print_view_manager_qt.h b/src/core/printing/print_view_manager_qt.h index 5825e7b6e..c181d9063 100644 --- a/src/core/printing/print_view_manager_qt.h +++ b/src/core/printing/print_view_manager_qt.h @@ -46,7 +46,7 @@ #include "print_view_manager_base_qt.h" -#include <QtWebEngineCore/qtwebenginecoreglobal.h> +#include "qtwebenginecoreglobal_p.h" #include "base/memory/ref_counted.h" #include "base/strings/string16.h" #include "components/prefs/pref_member.h" @@ -54,7 +54,6 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/web_contents_user_data.h" -#include "printing/buildflags/buildflags.h" struct PrintHostMsg_RequestPrintPreview_Params; struct PrintHostMsg_DidPreviewDocument_Params; @@ -85,7 +84,7 @@ public: ~PrintViewManagerQt() override; typedef base::Callback<void(const std::vector<char> &result)> PrintToPDFCallback; typedef base::Callback<void(bool success)> PrintToPDFFileCallback; -#if BUILDFLAG(ENABLE_BASIC_PRINTING) +#if QT_CONFIG(webengine_printing_and_pdf) // Method to print a page to a Pdf document with page size \a pageSize in location \a filePath. void PrintToPDFFileWithCallback(const QPageLayout &pageLayout, bool printInColor, @@ -95,7 +94,7 @@ public: bool printInColor, bool useCustomMargins, const PrintToPDFCallback &callback); -#endif // ENABLE_BASIC_PRINTING +#endif // QT_CONFIG(webengine_printing_and_pdf) base::string16 RenderSourceName() override; @@ -118,9 +117,9 @@ protected: void OnRequestPrintPreview(const PrintHostMsg_RequestPrintPreview_Params&); void OnMetafileReadyForPrinting(const PrintHostMsg_DidPreviewDocument_Params& params); -#if BUILDFLAG(ENABLE_BASIC_PRINTING) +#if QT_CONFIG(webengine_printing_and_pdf) bool PrintToPDFInternal(const QPageLayout &, bool printInColor, bool useCustomMargins = true); -#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) +#endif base::FilePath m_pdfOutputPath; PrintToPDFCallback m_pdfPrintCallback; |