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

Unified Diff: chrome/browser/ui/webui/options/create_profile_handler.cc

Issue 33753002: Sooper experimental refactoring of the profile info cache. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 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/ui/webui/options/create_profile_handler.cc
diff --git a/chrome/browser/ui/webui/options/create_profile_handler.cc b/chrome/browser/ui/webui/options/create_profile_handler.cc
index f88baccd631d6b44560ebe18424556d0957ccf1c..ef8c13c948225ca2de7904e9792e8f42cb9ff992 100644
--- a/chrome/browser/ui/webui/options/create_profile_handler.cc
+++ b/chrome/browser/ui/webui/options/create_profile_handler.cc
@@ -424,8 +424,11 @@ bool CreateProfileHandler::IsValidExistingManagedUserId(
// Check if this managed user already exists on this machine.
const ProfileInfoCache& cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
- for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) {
- if (existing_managed_user_id == cache.GetManagedUserIdOfProfileAtIndex(i))
+
+ const std::vector<ProfileInfoEntry> entries(cache.GetProfilesSortedByName());
+ for (std::vector<ProfileInfoEntry>::const_iterator it = entries.begin();
+ it != entries.end(); ++it) {
+ if (existing_managed_user_id == it->managed_user_id())
return false;
}
return true;
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | chrome/browser/ui/webui/options/manage_profile_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698