From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: clavin <clavin@electronjs.org>
Date: Sat, 13 Dec 2025 15:30:46 -0800
Subject: expose GTK UI platform field

Chromium used to expose this as a public static method, backed by global storage. In 7237910, these conveniences were removed.

This patch should be proposed upstream.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7237910 "7237910: Remove g_gtk_ui global"

diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc
index 393aa9918c97e9d61ef0f6e596aeeaa3d93862c6..5397fe5b57a60ea0948e412d0627c942f37dd0df 100644
--- a/extensions/renderer/script_injection.cc
+++ b/extensions/renderer/script_injection.cc
@@ -9,6 +9,7 @@
 
 #include "base/feature_list.h"
 #include "base/functional/bind.h"
+#include "base/functional/callback_helpers.h"
 #include "base/lazy_instance.h"
 #include "base/memory/raw_ptr.h"
 #include "base/metrics/histogram_macros.h"
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
index 40caafa5ce58104da7d5e96eb1efad1c99a77664..b388fc462e0c320170e5b35550e48b6b19079f40 100644
--- a/ui/gtk/gtk_ui.h
+++ b/ui/gtk/gtk_ui.h
@@ -53,6 +53,8 @@ class GtkUi : public ui::LinuxUiAndTheme {
 
   ~GtkUi() override;
 
+  GtkUiPlatform* GetPlatform() const { return platform_.get(); }
+
   // Setters used by SettingsProvider:
   void SetWindowButtonOrdering(
       const std::vector<views::FrameButton>& leading_buttons,
