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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // On Windows, Linux and Mac, the notification manager owns the tray icon and | 82 // On Windows, Linux and Mac, the notification manager owns the tray icon and |
83 // views.Other platforms have global ownership and Create will return NULL. | 83 // views.Other platforms have global ownership and Create will return NULL. |
84 tray_.reset(message_center::CreateMessageCenterTray()); | 84 tray_.reset(message_center::CreateMessageCenterTray()); |
85 #endif | 85 #endif |
86 registrar_.Add(this, | 86 registrar_.Add(this, |
87 chrome::NOTIFICATION_FULLSCREEN_CHANGED, | 87 chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
88 content::NotificationService::AllSources()); | 88 content::NotificationService::AllSources()); |
89 } | 89 } |
90 | 90 |
91 MessageCenterNotificationManager::~MessageCenterNotificationManager() { | 91 MessageCenterNotificationManager::~MessageCenterNotificationManager() { |
| 92 message_center_->SetNotifierSettingsProvider(NULL); |
92 message_center_->RemoveObserver(this); | 93 message_center_->RemoveObserver(this); |
93 } | 94 } |
94 | 95 |
95 void MessageCenterNotificationManager::RegisterPrefs( | 96 void MessageCenterNotificationManager::RegisterPrefs( |
96 PrefRegistrySimple* registry) { | 97 PrefRegistrySimple* registry) { |
97 registry->RegisterBooleanPref(prefs::kMessageCenterShowedFirstRunBalloon, | 98 registry->RegisterBooleanPref(prefs::kMessageCenterShowedFirstRunBalloon, |
98 false); | 99 false); |
99 registry->RegisterBooleanPref(prefs::kMessageCenterShowIcon, true); | 100 registry->RegisterBooleanPref(prefs::kMessageCenterShowIcon, true); |
100 registry->RegisterBooleanPref(prefs::kMessageCenterForcedOnTaskbar, false); | 101 registry->RegisterBooleanPref(prefs::kMessageCenterForcedOnTaskbar, false); |
101 } | 102 } |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 494 |
494 MessageCenterNotificationManager::ProfileNotification* | 495 MessageCenterNotificationManager::ProfileNotification* |
495 MessageCenterNotificationManager::FindProfileNotification( | 496 MessageCenterNotificationManager::FindProfileNotification( |
496 const std::string& id) const { | 497 const std::string& id) const { |
497 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 498 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
498 if (iter == profile_notifications_.end()) | 499 if (iter == profile_notifications_.end()) |
499 return NULL; | 500 return NULL; |
500 | 501 |
501 return (*iter).second; | 502 return (*iter).second; |
502 } | 503 } |
OLD | NEW |