| 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_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "ui/message_center/message_center_constants.h" | 22 #include "ui/message_center/message_center_constants.h" |
| 23 #include "ui/message_center/message_center_tray.h" | 23 #include "ui/message_center/message_center_tray.h" |
| 24 | 24 |
| 25 MessageCenterNotificationManager::MessageCenterNotificationManager( | 25 MessageCenterNotificationManager::MessageCenterNotificationManager( |
| 26 message_center::MessageCenter* message_center) | 26 message_center::MessageCenter* message_center) |
| 27 : message_center_(message_center), | 27 : message_center_(message_center), |
| 28 settings_controller_(new MessageCenterSettingsController) { | 28 settings_controller_(new MessageCenterSettingsController) { |
| 29 message_center_->SetDelegate(this); | 29 message_center_->SetDelegate(this); |
| 30 message_center_->AddObserver(this); | 30 message_center_->AddObserver(this); |
| 31 | 31 |
| 32 #if !defined(OS_CHROMEOS) | 32 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 33 // On Windows, the notification manager owns the tray icon and views. Other | 33 // On Windows and Mac, the notification manager owns the tray icon and views. |
| 34 // platforms have global ownership and Create will return NULL. | 34 // Other platforms have global ownership and Create will return NULL. |
| 35 tray_.reset(message_center::CreateMessageCenterTray()); | 35 tray_.reset(message_center::CreateMessageCenterTray()); |
| 36 #endif | 36 #endif |
| 37 } | 37 } |
| 38 | 38 |
| 39 MessageCenterNotificationManager::~MessageCenterNotificationManager() { | 39 MessageCenterNotificationManager::~MessageCenterNotificationManager() { |
| 40 message_center_->RemoveObserver(this); | 40 message_center_->RemoveObserver(this); |
| 41 } | 41 } |
| 42 | 42 |
| 43 | 43 |
| 44 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 458 |
| 459 MessageCenterNotificationManager::ProfileNotification* | 459 MessageCenterNotificationManager::ProfileNotification* |
| 460 MessageCenterNotificationManager::FindProfileNotification( | 460 MessageCenterNotificationManager::FindProfileNotification( |
| 461 const std::string& id) const { | 461 const std::string& id) const { |
| 462 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 462 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
| 463 if (iter == profile_notifications_.end()) | 463 if (iter == profile_notifications_.end()) |
| 464 return NULL; | 464 return NULL; |
| 465 | 465 |
| 466 return (*iter).second; | 466 return (*iter).second; |
| 467 } | 467 } |
| OLD | NEW |