| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 using message_center::NotifierId; | 41 using message_center::NotifierId; |
| 42 | 42 |
| 43 MessageCenterNotificationManager::MessageCenterNotificationManager( | 43 MessageCenterNotificationManager::MessageCenterNotificationManager( |
| 44 message_center::MessageCenter* message_center, | 44 message_center::MessageCenter* message_center, |
| 45 std::unique_ptr<message_center::NotifierSettingsProvider> settings_provider) | 45 std::unique_ptr<message_center::NotifierSettingsProvider> settings_provider) |
| 46 : message_center_(message_center), | 46 : message_center_(message_center), |
| 47 settings_provider_(std::move(settings_provider)), | 47 settings_provider_(std::move(settings_provider)), |
| 48 system_observer_(this), | 48 system_observer_(this), |
| 49 stats_collector_(message_center), | 49 stats_collector_(message_center) { |
| 50 google_now_stats_collector_(message_center) { | |
| 51 message_center_->AddObserver(this); | 50 message_center_->AddObserver(this); |
| 52 message_center_->SetNotifierSettingsProvider(settings_provider_.get()); | 51 message_center_->SetNotifierSettingsProvider(settings_provider_.get()); |
| 53 | 52 |
| 54 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
| 55 blockers_.push_back( | 54 blockers_.push_back( |
| 56 base::MakeUnique<LoginStateNotificationBlockerChromeOS>(message_center)); | 55 base::MakeUnique<LoginStateNotificationBlockerChromeOS>(message_center)); |
| 57 #else | 56 #else |
| 58 blockers_.push_back( | 57 blockers_.push_back( |
| 59 base::MakeUnique<ScreenLockNotificationBlocker>(message_center)); | 58 base::MakeUnique<ScreenLockNotificationBlocker>(message_center)); |
| 60 #endif | 59 #endif |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 } | 335 } |
| 337 | 336 |
| 338 ProfileNotification* MessageCenterNotificationManager::FindProfileNotification( | 337 ProfileNotification* MessageCenterNotificationManager::FindProfileNotification( |
| 339 const std::string& id) const { | 338 const std::string& id) const { |
| 340 auto iter = profile_notifications_.find(id); | 339 auto iter = profile_notifications_.find(id); |
| 341 if (iter == profile_notifications_.end()) | 340 if (iter == profile_notifications_.end()) |
| 342 return nullptr; | 341 return nullptr; |
| 343 | 342 |
| 344 return (*iter).second.get(); | 343 return (*iter).second.get(); |
| 345 } | 344 } |
| OLD | NEW |