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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
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::kMessageCenterForcedOnTaskbar, false); |
98 } | 99 } |
99 | 100 |
100 //////////////////////////////////////////////////////////////////////////////// | 101 //////////////////////////////////////////////////////////////////////////////// |
101 // NotificationUIManager | 102 // NotificationUIManager |
102 | 103 |
103 void MessageCenterNotificationManager::Add(const Notification& notification, | 104 void MessageCenterNotificationManager::Add(const Notification& notification, |
104 Profile* profile) { | 105 Profile* profile) { |
105 if (Update(notification, profile)) | 106 if (Update(notification, profile)) |
106 return; | 107 return; |
107 | 108 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 491 |
491 MessageCenterNotificationManager::ProfileNotification* | 492 MessageCenterNotificationManager::ProfileNotification* |
492 MessageCenterNotificationManager::FindProfileNotification( | 493 MessageCenterNotificationManager::FindProfileNotification( |
493 const std::string& id) const { | 494 const std::string& id) const { |
494 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 495 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
495 if (iter == profile_notifications_.end()) | 496 if (iter == profile_notifications_.end()) |
496 return NULL; | 497 return NULL; |
497 | 498 |
498 return (*iter).second; | 499 return (*iter).second; |
499 } | 500 } |
OLD | NEW |