diff --git a/src/core/browser_message_filter_qt.cpp b/src/core/browser_message_filter_qt.cpp
index 7551e56167afe4919ac20ad9f306f2a219d3d665..446dcb38bf47a22e27ee3facc966e1fbb911e8ba 100644
--- a/src/core/browser_message_filter_qt.cpp
+++ b/src/core/browser_message_filter_qt.cpp
@@ -58,7 +58,7 @@ BrowserMessageFilterQt::BrowserMessageFilterQt(int /*render_process_id*/)
 bool BrowserMessageFilterQt::OnMessageReceived(const IPC::Message& message)
 {
     IPC_BEGIN_MESSAGE_MAP(BrowserMessageFilterQt, message)
-#if defined(ENABLE_PEPPER_CDMS)
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
         IPC_MESSAGE_HANDLER(
             QtWebEngineHostMsg_IsInternalPluginAvailableForMimeType,
             OnIsInternalPluginAvailableForMimeType)
@@ -68,7 +68,7 @@ bool BrowserMessageFilterQt::OnMessageReceived(const IPC::Message& message)
     return true;
 }
 
-#if defined(ENABLE_PEPPER_CDMS)
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
 void BrowserMessageFilterQt::OnIsInternalPluginAvailableForMimeType(
     const std::string& mime_type, bool* is_available,
     std::vector<base::string16>* additional_param_names,
@@ -93,6 +93,6 @@ void BrowserMessageFilterQt::OnIsInternalPluginAvailableForMimeType(
     *is_available = false;
 }
 
-#endif // defined(ENABLE_PEPPER_CDMS)
+#endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
 
 } // namespace QtWebEngineCore
diff --git a/src/core/browser_message_filter_qt.h b/src/core/browser_message_filter_qt.h
index 75ca9fd84c185bb410dd3747fe8b6e9d62165b76..fe4897eced293aa261f36232632a345e76777164 100644
--- a/src/core/browser_message_filter_qt.h
+++ b/src/core/browser_message_filter_qt.h
@@ -41,6 +41,7 @@
 #define BROWSER_MESSAGE_FILTER_QT_H
 
 #include "content/public/browser/browser_message_filter.h"
+#include "ppapi/features/features.h"
 
 #include <QtGlobal>
 
@@ -53,7 +54,7 @@ public:
 
 private:
     bool OnMessageReceived(const IPC::Message& message) Q_DECL_OVERRIDE;
-#if defined(ENABLE_PEPPER_CDMS)
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
     // Returns whether any internal plugin supporting |mime_type| is registered
     // and enabled. Does not determine whether the plugin can actually be
     // instantiated (e.g. whether it has all its dependencies).
diff --git a/src/core/common/qt_messages.h b/src/core/common/qt_messages.h
index 2c971aab2f80314d70a5838c80e8e84c69731403..d998db20ed54e26e4d8cb627720c9e1cd1873654 100644
--- a/src/core/common/qt_messages.h
+++ b/src/core/common/qt_messages.h
@@ -6,6 +6,7 @@
 
 #include "content/public/common/common_param_traits.h"
 #include "ipc/ipc_message_macros.h"
+#include "ppapi/features/features.h"
 
 #include "user_script_data.h"
 
@@ -72,7 +73,7 @@ IPC_MESSAGE_ROUTED1(WebChannelIPCTransportHost_SendMessage, std::vector<char> /*
 // Misc messages
 // These are messages sent from the renderer to the browser process.
 
-#if defined(ENABLE_PEPPER_CDMS)
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
 // Returns whether any internal plugin supporting |mime_type| is registered and
 // enabled. Does not determine whether the plugin can actually be instantiated
 // (e.g. whether it has all its dependencies).
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index b45463d733989cfec98c0ad1e46d11dd6e7d1e5d..b30c4dfa773fea287023508635ba47b601466281 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -412,7 +412,7 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost*
     const int id = host->GetID();
     content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(id, url::kFileScheme);
     static_cast<BrowserContextQt*>(host->GetBrowserContext())->m_adapter->userResourceController()->renderProcessStartedWithHost(host);
-#if defined(ENABLE_PEPPER_CDMS)
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
     host->AddFilter(new BrowserMessageFilterQt(id));
 #endif
 #if BUILDFLAG(ENABLE_SPELLCHECK)
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 5d51f65aadd3b21f5a1933ec728ed764a28d0c48..b10a02fbd0156eef6c06500e16f39d470b34f695 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -193,7 +193,7 @@ void AddPepperFlashFromCommandLine(std::vector<content::PepperPluginInfo>* plugi
 
 void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins)
 {
-#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && !defined(WIDEVINE_CDM_IS_COMPONENT)
+#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) && !defined(WIDEVINE_CDM_IS_COMPONENT)
     QStringList pluginPaths;
     const base::CommandLine::StringType widevine_argument = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kPpapiWidevinePath);
     if (!widevine_argument.empty())
@@ -263,7 +263,7 @@ void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins)
             plugins->push_back(widevine_cdm);
         }
     }
-#endif  // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
+#endif  // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) &&
         // !defined(WIDEVINE_CDM_IS_COMPONENT)
 }
 
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 93badf853c4a5b68e001c520e97aa816d0f9dc0b..a2c2a722e543b48fddc79fd46837c23e13f43d89 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -222,7 +222,7 @@ bool ContentRendererClientQt::IsLinkVisited(unsigned long long linkHash)
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#if defined(ENABLE_PEPPER_CDMS)
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
 static const char kExternalClearKeyPepperType[] = "application/x-ppapi-clearkey-cdm";
 
 static bool IsPepperCdmAvailable(const std::string& pepper_type,
@@ -400,17 +400,17 @@ static void AddPepperBasedWidevine(std::vector<std::unique_ptr<media::KeySystemP
         media::EmeFeatureSupport::NOT_SUPPORTED));    // Distinctive identifier.
 }
 #endif  // defined(WIDEVINE_CDM_AVAILABLE)
-#endif  // defined(ENABLE_PEPPER_CDMS)
+#endif  // BUILDFLAG(ENABLE_PEPPER_CDMS)
 
 void ContentRendererClientQt::AddSupportedKeySystems(std::vector<std::unique_ptr<media::KeySystemProperties>> *key_systems)
 {
-#if defined(ENABLE_PEPPER_CDMS)
+#if BUILDFLAG(ENABLE_PEPPER_CDMS)
     AddExternalClearKey(key_systems);
 
 #if defined(WIDEVINE_CDM_AVAILABLE)
     AddPepperBasedWidevine(key_systems);
 #endif  // defined(WIDEVINE_CDM_AVAILABLE)
-#endif  // defined(ENABLE_PEPPER_CDMS)
+#endif  // BUILDFLAG(ENABLE_PEPPER_CDMS)
 }
 
 } // namespace