Commit c2c7f582 authored by benwells@chromium.org's avatar benwells@chromium.org

Remove call to IsTryingToQuit from BrowserListImpl::SetLastActive

Instead the profile manager watches notifications to determine this.

BUG=130456

Review URL: https://chromiumcodereview.appspot.com/10826044

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150743 0039d316-1c4b-4281-b951-d872f2087c98
parent 0f7cd865
...@@ -656,6 +656,13 @@ void ProfileManager::BrowserListObserver::OnBrowserRemoved( ...@@ -656,6 +656,13 @@ void ProfileManager::BrowserListObserver::OnBrowserRemoved(
void ProfileManager::BrowserListObserver::OnBrowserSetLastActive( void ProfileManager::BrowserListObserver::OnBrowserSetLastActive(
Browser* browser) { Browser* browser) {
// If all browsers are being closed (e.g. the user is in the process of
// shutting down), this event will be fired after each browser is
// closed. This does not represent a user intention to change the active
// browser so is not handled here.
if (profile_manager_->closing_all_browsers_)
return;
Profile* last_active = browser->profile(); Profile* last_active = browser->profile();
PrefService* local_state = g_browser_process->local_state(); PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state); DCHECK(local_state);
......
...@@ -105,11 +105,6 @@ void BrowserListImpl::RemoveObserver(BrowserListObserver* observer) { ...@@ -105,11 +105,6 @@ void BrowserListImpl::RemoveObserver(BrowserListObserver* observer) {
} }
void BrowserListImpl::SetLastActive(Browser* browser) { void BrowserListImpl::SetLastActive(Browser* browser) {
// If the browser is currently trying to quit, we don't want to set the last
// active browser because that can alter the last active browser that the user
// intended depending on the order in which the windows close.
if (browser_shutdown::IsTryingToQuit())
return;
RemoveBrowserFrom(browser, &last_active_browsers_); RemoveBrowserFrom(browser, &last_active_browsers_);
last_active_browsers_.push_back(browser); last_active_browsers_.push_back(browser);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment