| 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 #include "ui/message_center/message_center_impl.h" | 5 #include "ui/message_center/message_center_impl.h" |
| 6 | 6 |
| 7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
| 8 #include "ui/message_center/message_center_observer.h" | 8 #include "ui/message_center/message_center_observer.h" |
| 9 #include "ui/message_center/notification.h" | 9 #include "ui/message_center/notification.h" |
| 10 #include "ui/message_center/notification_list.h" | 10 #include "ui/message_center/notification_list.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 205 } |
| 206 | 206 |
| 207 void MessageCenterImpl::ExpandNotification(const std::string& id) { | 207 void MessageCenterImpl::ExpandNotification(const std::string& id) { |
| 208 notification_list_->MarkNotificationAsExpanded(id); | 208 notification_list_->MarkNotificationAsExpanded(id); |
| 209 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_, | 209 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_, |
| 210 OnNotificationUpdated(id)); | 210 OnNotificationUpdated(id)); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void MessageCenterImpl::ClickOnNotification(const std::string& id) { | 213 void MessageCenterImpl::ClickOnNotification(const std::string& id) { |
| 214 if (HasPopupNotifications()) | 214 if (HasPopupNotifications()) |
| 215 notification_list_->MarkSinglePopupAsShown(id, true); | 215 MarkSinglePopupAsShown(id, true); |
| 216 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_, | 216 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_, |
| 217 OnNotificationClicked(id)); | 217 OnNotificationClicked(id)); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void MessageCenterImpl::ClickOnNotificationButton(const std::string& id, | 220 void MessageCenterImpl::ClickOnNotificationButton(const std::string& id, |
| 221 int button_index) { | 221 int button_index) { |
| 222 if (HasPopupNotifications()) | 222 if (HasPopupNotifications()) |
| 223 notification_list_->MarkSinglePopupAsShown(id, true); | 223 MarkSinglePopupAsShown(id, true); |
| 224 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_, | 224 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_, |
| 225 OnNotificationButtonClicked(id, button_index)); | 225 OnNotificationButtonClicked(id, button_index)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void MessageCenterImpl::MarkSinglePopupAsShown(const std::string& id, | 228 void MessageCenterImpl::MarkSinglePopupAsShown(const std::string& id, |
| 229 bool mark_notification_as_read) { | 229 bool mark_notification_as_read) { |
| 230 notification_list_->MarkSinglePopupAsShown(id, mark_notification_as_read); | 230 notification_list_->MarkSinglePopupAsShown(id, mark_notification_as_read); |
| 231 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_, | 231 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_, |
| 232 OnNotificationUpdated(id)); | 232 OnNotificationUpdated(id)); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void MessageCenterImpl::SetQuietMode(bool in_quiet_mode) { | 235 void MessageCenterImpl::SetQuietMode(bool in_quiet_mode) { |
| 236 notification_list_->SetQuietMode(in_quiet_mode); | 236 notification_list_->SetQuietMode(in_quiet_mode); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void MessageCenterImpl::EnterQuietModeWithExpire( | 239 void MessageCenterImpl::EnterQuietModeWithExpire( |
| 240 const base::TimeDelta& expires_in) { | 240 const base::TimeDelta& expires_in) { |
| 241 notification_list_->EnterQuietModeWithExpire(expires_in); | 241 notification_list_->EnterQuietModeWithExpire(expires_in); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace message_center | 244 } // namespace message_center |
| OLD | NEW |