diff --git a/patches/chrome-app-chrome_main_delegate.cc.patch b/patches/chrome-app-chrome_main_delegate.cc.patch new file mode 100644 index 000000000000..1a7f5b86b69d --- /dev/null +++ b/patches/chrome-app-chrome_main_delegate.cc.patch @@ -0,0 +1,24 @@ +diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc +index 73b6ab0934b14609c5b4eba55b4cd0d0c09673af..0b4c44be679d0e92f9f3c206c98efd9cb37191bd 100644 +--- a/chrome/app/chrome_main_delegate.cc ++++ b/chrome/app/chrome_main_delegate.cc +@@ -249,6 +249,9 @@ + #include "base/scoped_add_feature_flags.h" + #include "ui/base/ui_base_features.h" + #include "ui/ozone/public/ozone_platform.h" ++#if BUILDFLAG(IS_LINUX) ++#include "chrome/browser/chrome_browser_main_extra_parts_linux.h" ++#endif + #endif // BUILDFLAG(IS_OZONE) + + base::LazyInstance::DestructorAtExit +@@ -959,6 +962,9 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( + // Initialize Ozone platform and add required feature flags as per platform's + // properties. Must be added before feature list is created otherwise the + // added flag won't be picked up. ++#if BUILDFLAG(IS_LINUX) ++ ChromeBrowserMainExtraPartsLinux::InitOzonePlatformHint(); ++#endif + ui::OzonePlatform::PreEarlyInitialization(); + AddFeatureFlagsToCommandLine(); + #endif // BUILDFLAG(IS_OZONE) diff --git a/patches/chrome-browser-chrome_browser_main_extra_parts_linux.cc.patch b/patches/chrome-browser-chrome_browser_main_extra_parts_linux.cc.patch new file mode 100644 index 000000000000..f2eadef51326 --- /dev/null +++ b/patches/chrome-browser-chrome_browser_main_extra_parts_linux.cc.patch @@ -0,0 +1,28 @@ +diff --git a/chrome/browser/chrome_browser_main_extra_parts_linux.cc b/chrome/browser/chrome_browser_main_extra_parts_linux.cc +index dba7b116ecaa07b8dd085284b5bd38b172a8f250..ea0487022dcdcf45aac35bf6170a27141bcb1157 100644 +--- a/chrome/browser/chrome_browser_main_extra_parts_linux.cc ++++ b/chrome/browser/chrome_browser_main_extra_parts_linux.cc +@@ -168,7 +168,13 @@ ChromeBrowserMainExtraPartsLinux::ChromeBrowserMainExtraPartsLinux() = default; + + ChromeBrowserMainExtraPartsLinux::~ChromeBrowserMainExtraPartsLinux() = default; + +-void ChromeBrowserMainExtraPartsLinux::PreEarlyInitialization() { ++void ChromeBrowserMainExtraPartsLinux::PostBrowserStart() { ++ RecordDisplayServerProtocolSupport(); ++ ChromeBrowserMainExtraPartsOzone::PostBrowserStart(); ++} ++ ++// static ++void ChromeBrowserMainExtraPartsLinux::InitOzonePlatformHint() { + #if BUILDFLAG(IS_LINUX) + // On the desktop, we fix the platform name if necessary. + // See https://crbug.com/1246928. +@@ -189,8 +195,3 @@ void ChromeBrowserMainExtraPartsLinux::PreEarlyInitialization() { + } + #endif // BUILDFLAG(IS_LINUX) + } +- +-void ChromeBrowserMainExtraPartsLinux::PostBrowserStart() { +- RecordDisplayServerProtocolSupport(); +- ChromeBrowserMainExtraPartsOzone::PostBrowserStart(); +-} diff --git a/patches/chrome-browser-chrome_browser_main_extra_parts_linux.h.patch b/patches/chrome-browser-chrome_browser_main_extra_parts_linux.h.patch new file mode 100644 index 000000000000..0e1cba85d315 --- /dev/null +++ b/patches/chrome-browser-chrome_browser_main_extra_parts_linux.h.patch @@ -0,0 +1,16 @@ +diff --git a/chrome/browser/chrome_browser_main_extra_parts_linux.h b/chrome/browser/chrome_browser_main_extra_parts_linux.h +index 3847bd2090e282486717fb211308915ec9251abe..4f188a7bdfe3867bcdf83ce9e442e94a002095b6 100644 +--- a/chrome/browser/chrome_browser_main_extra_parts_linux.h ++++ b/chrome/browser/chrome_browser_main_extra_parts_linux.h +@@ -17,9 +17,10 @@ class ChromeBrowserMainExtraPartsLinux + const ChromeBrowserMainExtraPartsLinux&) = delete; + ~ChromeBrowserMainExtraPartsLinux() override; + ++ static void InitOzonePlatformHint(); ++ + private: + // ChromeBrowserMainExtraParts overrides. +- void PreEarlyInitialization() override; + void PostBrowserStart() override; + }; +