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> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 void AddObserver(MessageCenterObserver* observer) override; | 42 void AddObserver(MessageCenterObserver* observer) override; |
43 void RemoveObserver(MessageCenterObserver* observer) override; | 43 void RemoveObserver(MessageCenterObserver* observer) override; |
44 void AddNotificationBlocker(NotificationBlocker* blocker) override; | 44 void AddNotificationBlocker(NotificationBlocker* blocker) override; |
45 void RemoveNotificationBlocker(NotificationBlocker* blocker) override; | 45 void RemoveNotificationBlocker(NotificationBlocker* blocker) override; |
46 void SetVisibility(Visibility visible) override; | 46 void SetVisibility(Visibility visible) override; |
47 bool IsMessageCenterVisible() const override; | 47 bool IsMessageCenterVisible() const override; |
48 size_t NotificationCount() const override; | 48 size_t NotificationCount() const override; |
49 size_t UnreadNotificationCount() const override; | 49 size_t UnreadNotificationCount() const override; |
50 bool HasPopupNotifications() const override; | 50 bool HasPopupNotifications() const override; |
51 bool IsQuietMode() const override; | 51 bool IsQuietMode() const override; |
52 bool IsLockedState() const override; | |
53 bool HasClickedListener(const std::string& id) override; | 52 bool HasClickedListener(const std::string& id) override; |
54 message_center::Notification* FindVisibleNotificationById( | 53 message_center::Notification* FindVisibleNotificationById( |
55 const std::string& id) override; | 54 const std::string& id) override; |
56 const NotificationList::Notifications& GetVisibleNotifications() override; | 55 const NotificationList::Notifications& GetVisibleNotifications() override; |
57 NotificationList::PopupNotifications GetPopupNotifications() override; | 56 NotificationList::PopupNotifications GetPopupNotifications() override; |
58 void AddNotification(std::unique_ptr<Notification> notification) override; | 57 void AddNotification(std::unique_ptr<Notification> notification) override; |
59 void UpdateNotification( | 58 void UpdateNotification( |
60 const std::string& old_id, | 59 const std::string& old_id, |
61 std::unique_ptr<Notification> new_notification) override; | 60 std::unique_ptr<Notification> new_notification) override; |
62 void RemoveNotification(const std::string& id, bool by_user) override; | 61 void RemoveNotification(const std::string& id, bool by_user) override; |
(...skipping 10 matching lines...) Expand all Loading... |
73 void ClickOnNotificationButton(const std::string& id, | 72 void ClickOnNotificationButton(const std::string& id, |
74 int button_index) override; | 73 int button_index) override; |
75 void ClickOnSettingsButton(const std::string& id) override; | 74 void ClickOnSettingsButton(const std::string& id) override; |
76 void MarkSinglePopupAsShown(const std::string& id, | 75 void MarkSinglePopupAsShown(const std::string& id, |
77 bool mark_notification_as_read) override; | 76 bool mark_notification_as_read) override; |
78 void DisplayedNotification(const std::string& id, | 77 void DisplayedNotification(const std::string& id, |
79 const DisplaySource source) override; | 78 const DisplaySource source) override; |
80 void SetNotifierSettingsProvider(NotifierSettingsProvider* provider) override; | 79 void SetNotifierSettingsProvider(NotifierSettingsProvider* provider) override; |
81 NotifierSettingsProvider* GetNotifierSettingsProvider() override; | 80 NotifierSettingsProvider* GetNotifierSettingsProvider() override; |
82 void SetQuietMode(bool in_quiet_mode) override; | 81 void SetQuietMode(bool in_quiet_mode) override; |
83 void SetLockedState(bool locked) override; | |
84 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in) override; | 82 void EnterQuietModeWithExpire(const base::TimeDelta& expires_in) override; |
85 void RestartPopupTimers() override; | 83 void RestartPopupTimers() override; |
86 void PausePopupTimers() override; | 84 void PausePopupTimers() override; |
87 void ForceNotificationFlush(const std::string& id) override; | 85 void ForceNotificationFlush(const std::string& id) override; |
88 | 86 |
89 // NotificationBlocker::Observer overrides: | 87 // NotificationBlocker::Observer overrides: |
90 void OnBlockingStateChanged(NotificationBlocker* blocker) override; | 88 void OnBlockingStateChanged(NotificationBlocker* blocker) override; |
91 | 89 |
92 // message_center::NotifierSettingsObserver overrides: | 90 // message_center::NotifierSettingsObserver overrides: |
93 void UpdateIconImage(const NotifierId& notifier_id, | 91 void UpdateIconImage(const NotifierId& notifier_id, |
(...skipping 27 matching lines...) Expand all Loading... |
121 void RemoveNotificationsForNotifierId(const NotifierId& notifier_id); | 119 void RemoveNotificationsForNotifierId(const NotifierId& notifier_id); |
122 | 120 |
123 std::unique_ptr<NotificationList> notification_list_; | 121 std::unique_ptr<NotificationList> notification_list_; |
124 NotificationCache notification_cache_; | 122 NotificationCache notification_cache_; |
125 base::ObserverList<MessageCenterObserver> observer_list_; | 123 base::ObserverList<MessageCenterObserver> observer_list_; |
126 std::unique_ptr<PopupTimersController> popup_timers_controller_; | 124 std::unique_ptr<PopupTimersController> popup_timers_controller_; |
127 std::unique_ptr<base::OneShotTimer> quiet_mode_timer_; | 125 std::unique_ptr<base::OneShotTimer> quiet_mode_timer_; |
128 NotifierSettingsProvider* settings_provider_; | 126 NotifierSettingsProvider* settings_provider_; |
129 std::vector<NotificationBlocker*> blockers_; | 127 std::vector<NotificationBlocker*> blockers_; |
130 | 128 |
131 bool locked_ = false; | |
132 bool visible_ = false; | |
133 | |
134 // Queue for the notifications to delay the addition/updates when the message | 129 // Queue for the notifications to delay the addition/updates when the message |
135 // center is visible. | 130 // center is visible. |
136 std::unique_ptr<internal::ChangeQueue> notification_queue_; | 131 std::unique_ptr<internal::ChangeQueue> notification_queue_; |
137 | 132 |
138 DISALLOW_COPY_AND_ASSIGN(MessageCenterImpl); | 133 DISALLOW_COPY_AND_ASSIGN(MessageCenterImpl); |
139 }; | 134 }; |
140 | 135 |
141 } // namespace message_center | 136 } // namespace message_center |
142 | 137 |
143 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 138 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
OLD | NEW |