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

Unified Diff: chrome/browser/notifications/message_center_settings_controller.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
« no previous file with comments | « chrome/browser/background/background_mode_manager.cc ('k') | chrome/browser/profiles/avatar_menu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/message_center_settings_controller.cc
diff --git a/chrome/browser/notifications/message_center_settings_controller.cc b/chrome/browser/notifications/message_center_settings_controller.cc
index b59967c65cafd9e0ff161f2b653c6be02c8f473c..40c90881667e3a97831f72e309ffa1c9e693e292 100644
--- a/chrome/browser/notifications/message_center_settings_controller.cc
+++ b/chrome/browser/notifications/message_center_settings_controller.cc
@@ -381,16 +381,18 @@ void MessageCenterSettingsController::RebuildNotifierGroups() {
notifier_groups_.clear();
current_notifier_group_ = 0;
- const size_t count = profile_info_cache_->GetNumberOfProfiles();
-
- for (size_t i = 0; i < count; ++i) {
+ const std::vector<ProfileInfoEntry> entries(
+ profile_info_cache_->GetProfilesSortedByName());
+ int index = 0;
+ for (std::vector<ProfileInfoEntry>::const_iterator it = entries.begin();
+ it != entries.end(); ++it) {
scoped_ptr<message_center::ProfileNotifierGroup> group(
new message_center::ProfileNotifierGroup(
- profile_info_cache_->GetAvatarIconOfProfileAtIndex(i),
- profile_info_cache_->GetNameOfProfileAtIndex(i),
- profile_info_cache_->GetUserNameOfProfileAtIndex(i),
- i,
- profile_info_cache_->GetPathOfProfileAtIndex(i)));
+ profile_info_cache_->GetAvatarIconOfProfile(it->path()),
+ it->GetDisplayName(),
+ it->user_name(),
+ index++,
+ it->path()));
if (group->profile() == NULL)
continue;
« no previous file with comments | « chrome/browser/background/background_mode_manager.cc ('k') | chrome/browser/profiles/avatar_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698