From aa4a7b828837ee4982c4a0c240b651bf88a7e598 Mon Sep 17 00:00:00 2001 From: Simon Hong Date: Tue, 2 May 2023 16:06:25 +0900 Subject: [PATCH] Fixed bookmark items are not shown from menu bar on macOS fix https://github.com/brave/brave-browser/issues/25644 When private window is removed cached bookmarkMenuBridge is cleared. As it's shared with non-OTR profile, it should be cleared when only non-OTR profile is removed. --- patches/chrome-browser-app_controller_mac.mm.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 patches/chrome-browser-app_controller_mac.mm.patch diff --git a/patches/chrome-browser-app_controller_mac.mm.patch b/patches/chrome-browser-app_controller_mac.mm.patch new file mode 100644 index 000000000000..bd8bb3708ff3 --- /dev/null +++ b/patches/chrome-browser-app_controller_mac.mm.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm +index 8463c92b822ddd3d8aca9795b4145c536346597e..8d4b45e3d0db698720c01ccacc4672ddb77d476e 100644 +--- a/chrome/browser/app_controller_mac.mm ++++ b/chrome/browser/app_controller_mac.mm +@@ -1103,7 +1103,7 @@ class AppControllerNativeThemeObserver : public ui::NativeThemeObserver { + } + + auto it = _profileBookmarkMenuBridgeMap.find(profilePath); +- if (it != _profileBookmarkMenuBridgeMap.end() && ++ if (it != _profileBookmarkMenuBridgeMap.end() && !isOffTheRecord && + (!base::FeatureList::IsEnabled(features::kDestroyProfileOnBrowserClose) || + (it->second->GetProfile() && !isOffTheRecord))) { + // Clean up the dangling Profile* in |_profileBookmarkMenuBridgeMap|.