| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_notification_manager.h" | 5 #include "chrome/browser/notifications/message_center_notification_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 MessageCenterNotificationManager::~MessageCenterNotificationManager() { | 90 MessageCenterNotificationManager::~MessageCenterNotificationManager() { |
| 91 message_center_->RemoveObserver(this); | 91 message_center_->RemoveObserver(this); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void MessageCenterNotificationManager::RegisterPrefs( | 94 void MessageCenterNotificationManager::RegisterPrefs( |
| 95 PrefRegistrySimple* registry) { | 95 PrefRegistrySimple* registry) { |
| 96 registry->RegisterBooleanPref(prefs::kMessageCenterShowedFirstRunBalloon, | 96 registry->RegisterBooleanPref(prefs::kMessageCenterShowedFirstRunBalloon, |
| 97 false); | 97 false); |
| 98 registry->RegisterBooleanPref(prefs::kMessageCenterShowIcon, true); | 98 registry->RegisterBooleanPref(prefs::kMessageCenterShowIcon, true); |
| 99 registry->RegisterBooleanPref(prefs::kMessageCenterForcedOnTaskbar, false); |
| 99 } | 100 } |
| 100 | 101 |
| 101 //////////////////////////////////////////////////////////////////////////////// | 102 //////////////////////////////////////////////////////////////////////////////// |
| 102 // NotificationUIManager | 103 // NotificationUIManager |
| 103 | 104 |
| 104 void MessageCenterNotificationManager::Add(const Notification& notification, | 105 void MessageCenterNotificationManager::Add(const Notification& notification, |
| 105 Profile* profile) { | 106 Profile* profile) { |
| 106 if (Update(notification, profile)) | 107 if (Update(notification, profile)) |
| 107 return; | 108 return; |
| 108 | 109 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 492 |
| 492 MessageCenterNotificationManager::ProfileNotification* | 493 MessageCenterNotificationManager::ProfileNotification* |
| 493 MessageCenterNotificationManager::FindProfileNotification( | 494 MessageCenterNotificationManager::FindProfileNotification( |
| 494 const std::string& id) const { | 495 const std::string& id) const { |
| 495 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 496 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
| 496 if (iter == profile_notifications_.end()) | 497 if (iter == profile_notifications_.end()) |
| 497 return NULL; | 498 return NULL; |
| 498 | 499 |
| 499 return (*iter).second; | 500 return (*iter).second; |
| 500 } | 501 } |
| OLD | NEW |