--- a/shell/browser/linux/x11_util.cc
+++ b/shell/browser/linux/x11_util.cc
@@ -6,12 +6,13 @@
 
 #include "build/build_config.h"
 #include "ui/ozone/platform_selection.h"  // nogncheck
+#include <string.h>
 
 namespace x11_util {
 
 bool IsX11() {
 #if BUILDFLAG(IS_LINUX)
-  static const bool is = ui::GetOzonePlatformId() == ui::kPlatformX11;
+  static const bool is = strcmp(ui::GetOzonePlatformName(),"x11");
   return is;
 #else
   return false;
@@ -20,7 +21,7 @@
 
 bool IsWayland() {
 #if BUILDFLAG(IS_LINUX)
-  static const bool is = ui::GetOzonePlatformId() == ui::kPlatformWayland;
+  static const bool is = strcmp(ui::GetOzonePlatformName(),"wayland");
   return is;
 #else
   return false;
