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

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: address review comments 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
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2a7a0ce758c1af197c9cac94136462562f3f446f..b4fe501b33fbb8233965ca646bbc6587cc7198a5 100644
--- a/chrome/browser/profiles/profile_info_cache.h
+++ b/chrome/browser/profiles/profile_info_cache.h
@@ -62,7 +62,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;
@@ -91,6 +91,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 profie.
+ 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_generic_icon,
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698