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

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

Issue 9087009: Restore all profiles which were active when restoring the last open pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 8 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.h
diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h
index 229d702da5aea44229ce602149548fe8736fba98..99c5cebae2c101bc587ed28190eeb4a8af627b12 100644
--- a/chrome/browser/profiles/profile_manager.h
+++ b/chrome/browser/profiles/profile_manager.h
@@ -86,13 +86,24 @@ class ProfileManager : public base::NonThreadSafe,
// relative to the user data directory currently in use..
FilePath GetInitialProfileDir();
- // Get the Profile last used with this Chrome build. If no signed profile has
- // been stored in Local State, hand back the Default profile.
+ // Get the Profile last used (the Profile to which owns the most recently
+ // focused window) with this Chrome build. If no signed profile has been
+ // stored in Local State, hand back the Default profile.
Profile* GetLastUsedProfile(const FilePath& user_data_dir);
// Same as instance method but provides the default user_data_dir as well.
static Profile* GetLastUsedProfile();
+ // Get the Profiles which are currently open, i.e., have open browsers, or
+ // were open the last time Chrome was running. The Profiles appear in the
+ // order they were opened. The last used profile will be on the list, but its
+ // index on the list will depend on when it was opened (it is not necessarily
+ // the last one).
+ std::vector<Profile*> GetLastOpenedProfiles(const FilePath& user_data_dir);
+
+ // Same as instance method but provides the default user_data_dir as well.
+ static std::vector<Profile*> GetLastOpenedProfiles();
+
// Returns created profiles. Note, profiles order is NOT guaranteed to be
// related with the creation order.
std::vector<Profile*> GetLoadedProfiles() const;
@@ -289,6 +300,11 @@ class ProfileManager : public base::NonThreadSafe,
scoped_ptr<ProfileShortcutManagerWin> profile_shortcut_manager_;
#endif
+ // For keeping track of the last active profiles.
+ std::map<Profile*, int> browser_counts_;
+ std::vector<Profile*> active_profiles_;
+ bool shutdown_started_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileManager);
};
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698