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

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

Issue 1214483002: Improve the ProfileInfoCache API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review feedback Created 5 years, 6 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_info_cache.h
diff --git a/chrome/browser/profiles/profile_info_cache.h b/chrome/browser/profiles/profile_info_cache.h
index 38edaa2ca68faa0e8d9eed414d9d59073d84d743..f7c57c3fc548c9562efe88bd414f5c8151ee139e 100644
--- a/chrome/browser/profiles/profile_info_cache.h
+++ b/chrome/browser/profiles/profile_info_cache.h
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
+#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_info_cache_observer.h"
#include "chrome/browser/profiles/profile_info_interface.h"
@@ -34,6 +35,7 @@ class ProfileAvatarDownloader;
// This cache can be used to display a list of profiles without having to
// actually load the profiles from disk.
class ProfileInfoCache : public ProfileInfoInterface,
+ public ProfileAttributesStorage,
public base::SupportsWeakPtr<ProfileInfoCache> {
public:
ProfileInfoCache(PrefService* prefs, const base::FilePath& user_data_dir);
@@ -161,6 +163,19 @@ class ProfileInfoCache : public ProfileInfoInterface,
disable_avatar_download_for_testing_ = disable_avatar_download_for_testing;
}
+ // ProfileMetadataStorage:
+ void AddProfile(const base::FilePath& profile_path,
+ const base::string16& name,
+ const std::string& gaia_id,
+ const base::string16& user_name,
+ size_t icon_index,
+ const std::string& supervised_user_id) override;
+ void DeleteProfile(const base::FilePath& profile_path) override;
+ std::vector<ProfileAttributesEntry> GetAllProfilesAttributes() override;
Mike Lerman 2015/07/02 18:01:31 This is now an unordered collection. Perhaps retur
anthonyvd 2015/07/07 21:05:32 I believe this would make using this function hard
Mike Lerman 2015/07/08 18:26:34 Easily sort - because you can do an in-place sort.
anthonyvd 2015/07/09 17:02:13 Exactly! Done.
+ bool GetProfileAttributesWithPath(
+ const base::FilePath& path,
+ ProfileAttributesEntry* entry) override;
+
private:
FRIEND_TEST_ALL_PREFIXES(ProfileInfoCacheTest, DownloadHighResAvatarTest);
FRIEND_TEST_ALL_PREFIXES(ProfileInfoCacheTest,

Powered by Google App Engine
This is Rietveld 408576698