OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/notifications/message_center_settings_controller.h" | 5 #include "chrome/browser/notifications/message_center_settings_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/string_compare.h" | 10 #include "base/i18n/string_compare.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 observers_, | 364 observers_, |
365 NotifierGroupChanged()); | 365 NotifierGroupChanged()); |
366 } | 366 } |
367 | 367 |
368 void MessageCenterSettingsController::RebuildNotifierGroups() { | 368 void MessageCenterSettingsController::RebuildNotifierGroups() { |
369 notifier_groups_.clear(); | 369 notifier_groups_.clear(); |
370 current_notifier_group_ = 0; | 370 current_notifier_group_ = 0; |
371 | 371 |
372 const size_t count = profile_info_cache_->GetNumberOfProfiles(); | 372 const size_t count = profile_info_cache_->GetNumberOfProfiles(); |
373 for (size_t i = 0; i < count; ++i) { | 373 for (size_t i = 0; i < count; ++i) { |
374 message_center::ProfileNotifierGroup* group = | 374 scoped_ptr<message_center::ProfileNotifierGroup> group( |
375 new message_center::ProfileNotifierGroup( | 375 new message_center::ProfileNotifierGroup( |
376 profile_info_cache_->GetAvatarIconOfProfileAtIndex(i), | 376 profile_info_cache_->GetAvatarIconOfProfileAtIndex(i), |
377 profile_info_cache_->GetNameOfProfileAtIndex(i), | 377 profile_info_cache_->GetNameOfProfileAtIndex(i), |
378 profile_info_cache_->GetUserNameOfProfileAtIndex(i), | 378 profile_info_cache_->GetUserNameOfProfileAtIndex(i), |
379 i, | 379 i, |
380 profile_info_cache_->GetPathOfProfileAtIndex(i)); | 380 profile_info_cache_->GetPathOfProfileAtIndex(i))); |
381 if (group->profile() != NULL) { | 381 if (group->profile() != NULL) |
382 notifier_groups_.push_back(group); | 382 notifier_groups_.push_back(group.release()); |
383 } | |
384 } | 383 } |
385 } | 384 } |
OLD | NEW |