| 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/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "ui/gfx/image/image_skia.h" | 28 #include "ui/gfx/image/image_skia.h" |
| 29 #include "ui/message_center/message_center_style.h" | 29 #include "ui/message_center/message_center_style.h" |
| 30 #include "ui/message_center/message_center_tray.h" | 30 #include "ui/message_center/message_center_tray.h" |
| 31 #include "ui/message_center/message_center_types.h" | 31 #include "ui/message_center/message_center_types.h" |
| 32 #include "ui/message_center/notifier_settings.h" | 32 #include "ui/message_center/notifier_settings.h" |
| 33 | 33 |
| 34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
| 35 #include "chrome/browser/notifications/login_state_notification_blocker_chromeos
.h" | 35 #include "chrome/browser/notifications/login_state_notification_blocker_chromeos
.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 namespace { | 38 #if defined(OS_WIN) |
| 39 // The first-run balloon will be shown |kFirstRunIdleDelaySeconds| after all | 39 // The first-run balloon will be shown |kFirstRunIdleDelaySeconds| after all |
| 40 // popups go away and the user has notifications in the message center. | 40 // popups go away and the user has notifications in the message center. |
| 41 const int kFirstRunIdleDelaySeconds = 1; | 41 const int kFirstRunIdleDelaySeconds = 1; |
| 42 } // namespace | 42 #endif |
| 43 | 43 |
| 44 MessageCenterNotificationManager::MessageCenterNotificationManager( | 44 MessageCenterNotificationManager::MessageCenterNotificationManager( |
| 45 message_center::MessageCenter* message_center, | 45 message_center::MessageCenter* message_center, |
| 46 PrefService* local_state, | 46 PrefService* local_state, |
| 47 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider) | 47 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider) |
| 48 : message_center_(message_center), | 48 : message_center_(message_center), |
| 49 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| 50 first_run_idle_timeout_( | 50 first_run_idle_timeout_( |
| 51 base::TimeDelta::FromSeconds(kFirstRunIdleDelaySeconds)), | 51 base::TimeDelta::FromSeconds(kFirstRunIdleDelaySeconds)), |
| 52 weak_factory_(this), | 52 weak_factory_(this), |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 | 464 |
| 465 MessageCenterNotificationManager::ProfileNotification* | 465 MessageCenterNotificationManager::ProfileNotification* |
| 466 MessageCenterNotificationManager::FindProfileNotification( | 466 MessageCenterNotificationManager::FindProfileNotification( |
| 467 const std::string& id) const { | 467 const std::string& id) const { |
| 468 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 468 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
| 469 if (iter == profile_notifications_.end()) | 469 if (iter == profile_notifications_.end()) |
| 470 return NULL; | 470 return NULL; |
| 471 | 471 |
| 472 return (*iter).second; | 472 return (*iter).second; |
| 473 } | 473 } |
| OLD | NEW |