| 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 return; | 468 return; |
| 469 | 469 |
| 470 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 470 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); |
| 471 // |notifier_groups_| can be empty in login screen too. | 471 // |notifier_groups_| can be empty in login screen too. |
| 472 if (!user_manager->IsLoggedInAsGuest()) | 472 if (!user_manager->IsLoggedInAsGuest()) |
| 473 return; | 473 return; |
| 474 | 474 |
| 475 chromeos::User* user = user_manager->GetActiveUser(); | 475 chromeos::User* user = user_manager->GetActiveUser(); |
| 476 Profile* profile = user_manager->GetProfileByUser(user); | 476 Profile* profile = user_manager->GetProfileByUser(user); |
| 477 DCHECK(profile); | 477 DCHECK(profile); |
| 478 notifier_groups_.push_back(new message_center::ProfileNotifierGroup( | 478 notifier_groups_.push_back( |
| 479 gfx::Image(user->image()), | 479 new message_center::ProfileNotifierGroup(gfx::Image(user->GetImage()), |
| 480 user->GetDisplayName(), | 480 user->GetDisplayName(), |
| 481 user->GetDisplayName(), | 481 user->GetDisplayName(), |
| 482 0, | 482 0, |
| 483 profile)); | 483 profile)); |
| 484 | 484 |
| 485 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, | 485 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, |
| 486 observers_, | 486 observers_, |
| 487 NotifierGroupChanged()); | 487 NotifierGroupChanged()); |
| 488 } | 488 } |
| 489 #endif | 489 #endif |
| 490 | 490 |
| 491 void MessageCenterSettingsController::RebuildNotifierGroups() { | 491 void MessageCenterSettingsController::RebuildNotifierGroups() { |
| 492 notifier_groups_.clear(); | 492 notifier_groups_.clear(); |
| 493 current_notifier_group_ = 0; | 493 current_notifier_group_ = 0; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 // creating a primary profile, and causes an infinite loop. | 538 // creating a primary profile, and causes an infinite loop. |
| 539 // Thus, it would be better to delay creating group for guest login. | 539 // Thus, it would be better to delay creating group for guest login. |
| 540 base::MessageLoopProxy::current()->PostTask( | 540 base::MessageLoopProxy::current()->PostTask( |
| 541 FROM_HERE, | 541 FROM_HERE, |
| 542 base::Bind( | 542 base::Bind( |
| 543 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, | 543 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, |
| 544 weak_factory_.GetWeakPtr())); | 544 weak_factory_.GetWeakPtr())); |
| 545 } | 545 } |
| 546 #endif | 546 #endif |
| 547 } | 547 } |
| OLD | NEW |