| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_IMPL_H_ | 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_IMPL_H_ |
| 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_IMPL_H_ | 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/thread_checker.h" |
| 16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 17 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
| 18 #include "ui/message_center/message_center.h" | 19 #include "ui/message_center/message_center.h" |
| 19 #include "ui/message_center/message_center_observer.h" | 20 #include "ui/message_center/message_center_observer.h" |
| 20 #include "ui/message_center/message_center_types.h" | 21 #include "ui/message_center/message_center_types.h" |
| 21 #include "ui/message_center/notification_blocker.h" | 22 #include "ui/message_center/notification_blocker.h" |
| 22 #include "ui/message_center/notifier_settings.h" | 23 #include "ui/message_center/notifier_settings.h" |
| 23 #include "ui/message_center/popup_timers_controller.h" | 24 #include "ui/message_center/popup_timers_controller.h" |
| 24 | 25 |
| 25 namespace message_center { | 26 namespace message_center { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 ~NotificationCache(); | 113 ~NotificationCache(); |
| 113 void Rebuild(const NotificationList::Notifications& notifications); | 114 void Rebuild(const NotificationList::Notifications& notifications); |
| 114 void RecountUnread(); | 115 void RecountUnread(); |
| 115 | 116 |
| 116 NotificationList::Notifications visible_notifications; | 117 NotificationList::Notifications visible_notifications; |
| 117 size_t unread_count; | 118 size_t unread_count; |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 void RemoveNotificationsForNotifierId(const NotifierId& notifier_id); | 121 void RemoveNotificationsForNotifierId(const NotifierId& notifier_id); |
| 121 | 122 |
| 123 THREAD_CHECKER(thread_checker_); |
| 124 |
| 122 std::unique_ptr<NotificationList> notification_list_; | 125 std::unique_ptr<NotificationList> notification_list_; |
| 123 NotificationCache notification_cache_; | 126 NotificationCache notification_cache_; |
| 124 base::ObserverList<MessageCenterObserver> observer_list_; | 127 base::ObserverList<MessageCenterObserver> observer_list_; |
| 125 std::unique_ptr<PopupTimersController> popup_timers_controller_; | 128 std::unique_ptr<PopupTimersController> popup_timers_controller_; |
| 126 std::unique_ptr<base::OneShotTimer> quiet_mode_timer_; | 129 std::unique_ptr<base::OneShotTimer> quiet_mode_timer_; |
| 127 NotifierSettingsProvider* settings_provider_; | 130 NotifierSettingsProvider* settings_provider_; |
| 128 std::vector<NotificationBlocker*> blockers_; | 131 std::vector<NotificationBlocker*> blockers_; |
| 129 | 132 |
| 130 bool locked_ = false; | 133 bool locked_ = false; |
| 131 bool visible_ = false; | 134 bool visible_ = false; |
| 132 | 135 |
| 133 // Queue for the notifications to delay the addition/updates when the message | 136 // Queue for the notifications to delay the addition/updates when the message |
| 134 // center is visible. | 137 // center is visible. |
| 135 std::unique_ptr<internal::ChangeQueue> notification_queue_; | 138 std::unique_ptr<internal::ChangeQueue> notification_queue_; |
| 136 | 139 |
| 137 DISALLOW_COPY_AND_ASSIGN(MessageCenterImpl); | 140 DISALLOW_COPY_AND_ASSIGN(MessageCenterImpl); |
| 138 }; | 141 }; |
| 139 | 142 |
| 140 } // namespace message_center | 143 } // namespace message_center |
| 141 | 144 |
| 142 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 145 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
| OLD | NEW |