summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac.mm
diff options
context:
space:
mode:
authormlerman <mlerman@chromium.org>2015-04-22 06:09:34 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-22 13:09:40 +0000
commitef6d33eabfb3d553153217a3b874dd6a0cfdf961 (patch)
treecf19317089b6c8bbb42ec9030384c42085bffd68 /chrome/browser/app_controller_mac.mm
parent732e5fd8f383344307338fecf199b8b3dbe9a80c (diff)
downloadchromium_src-ef6d33eabfb3d553153217a3b874dd6a0cfdf961.zip
chromium_src-ef6d33eabfb3d553153217a3b874dd6a0cfdf961.tar.gz
chromium_src-ef6d33eabfb3d553153217a3b874dd6a0cfdf961.tar.bz2
AppControllerMac updates the window when a Profile is deleted.
BUG=477392 TEST=(Mac only) Have at least two profiles. Open one of the profiles. navigate to generate browser history, verify it in the History Menu. Delete the profile; note that history should no longer show the deleted profile's history. Review URL: https://codereview.chromium.org/1097553002 Cr-Commit-Position: refs/heads/master@{#326281}
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);
}