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

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

Issue 8227025: Multi-Profiles: Fix choosing random profile avatar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 509016a6efcf72039373ca8bc93100a73da7bfe0..dd1b6d51aecbfac30f270c16ec8033085b9d41e8 100644
--- a/chrome/browser/profiles/profile_info_cache.h
+++ b/chrome/browser/profiles/profile_info_cache.h
@@ -61,7 +61,7 @@ class ProfileInfoCache : public ProfileInfoInterface {
// Returns an avatar icon index that can be assigned to a newly created
// profile. Note that the icon may not be unique since there are a limited
// set of default icons.
- int ChooseAvatarIconIndexForNewProfile();
+ size_t ChooseAvatarIconIndexForNewProfile() const;
const FilePath& GetUserDataDir() const;
@@ -90,6 +90,15 @@ class ProfileInfoCache : public ProfileInfoInterface {
std::string search_key,
const string16& search_name);
+ // Returns true if the given icon index is not in use by another other profie.
Miranda Callahan 2011/10/11 19:17:51 Remove other.
+ bool IconIndexIsUnique(size_t icon_index) const;
+
+ // Tries to find an icon index that satisfies all the given conditions.
+ // Returns true if an icon was found, false otherwise.
+ bool ChooseAvatarIconIndexForNewProfile(bool allow_gender_neutral,
+ bool must_be_unique,
+ size_t* out_icon_index) const;
+
PrefService* prefs_;
std::vector<std::string> sorted_keys_;
FilePath user_data_dir_;
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache.cc » ('j') | chrome/browser/profiles/profile_info_cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698