Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 1102833002: Reland: AppControllerMac updates the window when a Profile is deleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/app_controller_mac.h ('k') | chrome/browser/app_controller_mac_browsertest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/browser/app_controller_mac.h ('k') | chrome/browser/app_controller_mac_browsertest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698