Index: chrome/browser/app_controller_mac.mm |
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm |
index e888d39706118066c32b37493796c7ab2b0cb6c1..91ae93205314708c7dc9ade72d85264fe460c0f9 100644 |
--- a/chrome/browser/app_controller_mac.mm |
+++ b/chrome/browser/app_controller_mac.mm |
@@ -893,8 +893,13 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { |
// to the old profile. |
// In a browser test, the application is not brought to the front, so |
// |lastProfile_| might be null. |
- if (!lastProfile_ || profilePath == lastProfile_->GetPath()) |
- lastProfile_ = g_browser_process->profile_manager()->GetLastUsedProfile(); |
+ if (!lastProfile_ || profilePath == lastProfile_->GetPath()) { |
+ // Force windowChangedToProfile: to set the lastProfile_ and also update the |
+ // relevant menuBridge objects. |
+ lastProfile_ = nullptr; |
+ [self windowChangedToProfile:g_browser_process->profile_manager()-> |
+ GetLastUsedProfile()]; |
+ } |
auto it = profileBookmarkMenuBridgeMap_.find(profilePath); |
if (it != profileBookmarkMenuBridgeMap_.end()) { |
@@ -1549,6 +1554,10 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { |
return bookmarkMenuBridge_; |
} |
+- (HistoryMenuBridge*)historyMenuBridge { |
+ return historyMenuBridge_.get(); |
+} |
+ |
- (void)addObserverForWorkAreaChange:(ui::WorkAreaWatcherObserver*)observer { |
workAreaChangeObservers_.AddObserver(observer); |
} |