summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r--chrome/browser/app_controller_mac.mm13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index e888d39..91ae932 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);
}