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

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

Issue 8502033: Add Windows desktop shortcut for multiple profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: refactor GetProfileNames and add Callback wrapper Created 9 years, 1 month 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_info_cache.h
===================================================================
--- chrome/browser/profiles/profile_info_cache.h (revision 109887)
+++ chrome/browser/profiles/profile_info_cache.h (working copy)
@@ -12,7 +12,9 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/file_path.h"
+#include "base/observer_list.h"
#include "base/string16.h"
+#include "chrome/browser/profiles/profile_info_cache_observer.h"
#include "chrome/browser/profiles/profile_info_interface.h"
namespace gfx {
@@ -25,7 +27,6 @@
class PrefService;
-
// This class saves various information about profiles to local preferences.
// This cache can be used to display a list of profiles without having to
// actually load the profiles from disk.
@@ -83,13 +84,22 @@
static bool IsDefaultAvatarIconUrl(const std::string& icon_url,
size_t *icon_index);
+ // Gets all names of profiles associated with this instance of Chrome.
+ // Because this method will be called during uninstall, before the creation
+ // of the ProfileManager, it reads directly from the local state preferences,
+ // rather than going through the ProfileInfoCache object.
+ static std::vector<string16> GetProfileNames();
sail 2011/11/18 07:14:25 How about just creating a new instance of ProfileI
Miranda Callahan 2011/11/18 19:00:36 I thought about that -- and was kind of torn! Here
+
// Register cache related preferences in Local State.
static void RegisterPrefs(PrefService* prefs);
+ void AddObserver(ProfileInfoCacheObserver* obs);
+ void RemoveObserver(ProfileInfoCacheObserver* obs);
+
private:
const base::DictionaryValue* GetInfoForProfileAtIndex(size_t index) const;
// Saves the profile info to a cache and takes ownership of |info|.
- // Currently the only information that is cached is the profiles name,
+ // Currently the only information that is cached is the profile's name,
// user name, and avatar icon.
void SetInfoForProfileAtIndex(size_t index, base::DictionaryValue* info);
std::string CacheKeyFromProfilePath(const FilePath& profile_path) const;
@@ -110,6 +120,8 @@
std::vector<std::string> sorted_keys_;
FilePath user_data_dir_;
+ ObserverList<ProfileInfoCacheObserver> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache);
};

Powered by Google App Engine
This is Rietveld 408576698