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

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: Fix. 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
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..b37010327bfa5a6d86be5cab5d883f056bf53168 100644
--- a/chrome/browser/profiles/profile_manager.h
+++ b/chrome/browser/profiles/profile_manager.h
@@ -93,6 +93,13 @@ class ProfileManager : public base::NonThreadSafe,
// Same as instance method but provides the default user_data_dir as well.
static Profile* GetLastUsedProfile();
+ // Get the Profiles which are currently active, i.e., have open browsers, (or
+ // were active the last time Chrome was running).
+ std::vector<Profile*> GetLastActiveProfiles(const FilePath& user_data_dir);
+
+ // Same as instance method but provides the default user_data_dir as well.
+ static std::vector<Profile*> GetLastActiveProfiles();
+
// Returns created profiles. Note, profiles order is NOT guaranteed to be
// related with the creation order.
std::vector<Profile*> GetLoadedProfiles() const;
@@ -289,6 +296,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);
};

Powered by Google App Engine
This is Rietveld 408576698