| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
| 72 blockers_.push_back( | 72 blockers_.push_back( |
| 73 new LoginStateNotificationBlockerChromeOS(message_center)); | 73 new LoginStateNotificationBlockerChromeOS(message_center)); |
| 74 #else | 74 #else |
| 75 blockers_.push_back(new ScreenLockNotificationBlocker(message_center)); | 75 blockers_.push_back(new ScreenLockNotificationBlocker(message_center)); |
| 76 #endif | 76 #endif |
| 77 blockers_.push_back(new FullscreenNotificationBlocker(message_center)); | 77 blockers_.push_back(new FullscreenNotificationBlocker(message_center)); |
| 78 | 78 |
| 79 #if defined(OS_WIN) || defined(OS_MACOSX) \ | 79 #if defined(OS_WIN) || defined(OS_MACOSX) \ |
| 80 || (defined(USE_AURA) && !defined(USE_ASH)) | 80 || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 81 // On Windows, Linux and Mac, the notification manager owns the tray icon and | 81 // On Windows, Linux and Mac, the notification manager owns the tray icon and |
| 82 // views.Other platforms have global ownership and Create will return NULL. | 82 // views.Other platforms have global ownership and Create will return NULL. |
| 83 tray_.reset(message_center::CreateMessageCenterTray()); | 83 tray_.reset(message_center::CreateMessageCenterTray()); |
| 84 #endif | 84 #endif |
| 85 registrar_.Add(this, | 85 registrar_.Add(this, |
| 86 chrome::NOTIFICATION_FULLSCREEN_CHANGED, | 86 chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
| 87 content::NotificationService::AllSources()); | 87 content::NotificationService::AllSources()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 MessageCenterNotificationManager::~MessageCenterNotificationManager() { | 90 MessageCenterNotificationManager::~MessageCenterNotificationManager() { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 491 |
| 492 MessageCenterNotificationManager::ProfileNotification* | 492 MessageCenterNotificationManager::ProfileNotification* |
| 493 MessageCenterNotificationManager::FindProfileNotification( | 493 MessageCenterNotificationManager::FindProfileNotification( |
| 494 const std::string& id) const { | 494 const std::string& id) const { |
| 495 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 495 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
| 496 if (iter == profile_notifications_.end()) | 496 if (iter == profile_notifications_.end()) |
| 497 return NULL; | 497 return NULL; |
| 498 | 498 |
| 499 return (*iter).second; | 499 return (*iter).second; |
| 500 } | 500 } |
| OLD | NEW |