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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 134863002: Track when profiles are last used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index df865407d29459816c6de0c5a1daa55b0c522f3b..19ad8271de91a5bd536fb60a3d9ca4cc2f00875c 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -765,6 +765,12 @@ void ProfileManager::BrowserListObserver::OnBrowserSetLastActive(
return;
Profile* last_active = browser->profile();
+ ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache();
+ size_t profile_index =
+ cache.GetIndexOfProfileWithPath(last_active->GetPath());
+ if (profile_index != std::string::npos) {
+ cache.SetProfileActive(profile_index);
+ }
// Don't remember ephemeral profiles as last because they are not going to
// persist after restart.

Powered by Google App Engine
This is Rietveld 408576698