| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 PrefService* local_state, | 53 PrefService* local_state, |
| 54 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider) | 54 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider) |
| 55 : message_center_(message_center), | 55 : message_center_(message_center), |
| 56 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
| 57 first_run_idle_timeout_( | 57 first_run_idle_timeout_( |
| 58 base::TimeDelta::FromSeconds(kFirstRunIdleDelaySeconds)), | 58 base::TimeDelta::FromSeconds(kFirstRunIdleDelaySeconds)), |
| 59 weak_factory_(this), | 59 weak_factory_(this), |
| 60 #endif | 60 #endif |
| 61 settings_provider_(settings_provider.Pass()), | 61 settings_provider_(settings_provider.Pass()), |
| 62 system_observer_(this), | 62 system_observer_(this), |
| 63 stats_collector_(message_center) { | 63 stats_collector_(message_center), |
| 64 google_now_stats_collector_(message_center) { |
| 64 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
| 65 first_run_pref_.Init(prefs::kMessageCenterShowedFirstRunBalloon, local_state); | 66 first_run_pref_.Init(prefs::kMessageCenterShowedFirstRunBalloon, local_state); |
| 66 #endif | 67 #endif |
| 67 | 68 |
| 68 message_center_->AddObserver(this); | 69 message_center_->AddObserver(this); |
| 69 message_center_->SetNotifierSettingsProvider(settings_provider_.get()); | 70 message_center_->SetNotifierSettingsProvider(settings_provider_.get()); |
| 70 | 71 |
| 71 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
| 72 blockers_.push_back( | 73 blockers_.push_back( |
| 73 new LoginStateNotificationBlockerChromeOS(message_center)); | 74 new LoginStateNotificationBlockerChromeOS(message_center)); |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 493 |
| 493 MessageCenterNotificationManager::ProfileNotification* | 494 MessageCenterNotificationManager::ProfileNotification* |
| 494 MessageCenterNotificationManager::FindProfileNotification( | 495 MessageCenterNotificationManager::FindProfileNotification( |
| 495 const std::string& id) const { | 496 const std::string& id) const { |
| 496 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 497 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
| 497 if (iter == profile_notifications_.end()) | 498 if (iter == profile_notifications_.end()) |
| 498 return NULL; | 499 return NULL; |
| 499 | 500 |
| 500 return (*iter).second; | 501 return (*iter).second; |
| 501 } | 502 } |
| OLD | NEW |