| 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 "ui/message_center/message_center.h" | 5 #include "ui/message_center/message_center.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 void MessageCenter::ShowNotificationSettings(const std::string& id) { | 135 void MessageCenter::ShowNotificationSettings(const std::string& id) { |
| 136 if (delegate_) | 136 if (delegate_) |
| 137 delegate_->ShowSettings(id); | 137 delegate_->ShowSettings(id); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void MessageCenter::OnNotificationClicked(const std::string& id) { | 140 void MessageCenter::OnNotificationClicked(const std::string& id) { |
| 141 if (delegate_) | 141 if (delegate_) |
| 142 delegate_->OnClicked(id); | 142 delegate_->OnClicked(id); |
| 143 if (HasPopupNotifications()) { |
| 144 notification_list_->MarkSinglePopupAsShown(id); |
| 145 NotifyMessageCenterChanged(false); |
| 146 } |
| 143 } | 147 } |
| 144 | 148 |
| 145 void MessageCenter::OnQuietModeChanged(bool quiet_mode) { | 149 void MessageCenter::OnQuietModeChanged(bool quiet_mode) { |
| 146 NotifyMessageCenterChanged(true); | 150 NotifyMessageCenterChanged(true); |
| 147 } | 151 } |
| 148 | 152 |
| 149 void MessageCenter::OnButtonClicked(const std::string& id, int button_index) { | 153 void MessageCenter::OnButtonClicked(const std::string& id, int button_index) { |
| 150 if (delegate_) | 154 if (delegate_) |
| 151 delegate_->OnButtonClicked(id, button_index); | 155 delegate_->OnButtonClicked(id, button_index); |
| 152 } | 156 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 168 } | 172 } |
| 169 | 173 |
| 170 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { | 174 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { |
| 171 FOR_EACH_OBSERVER(Observer, | 175 FOR_EACH_OBSERVER(Observer, |
| 172 observer_list_, | 176 observer_list_, |
| 173 OnMessageCenterChanged(new_notification)); | 177 OnMessageCenterChanged(new_notification)); |
| 174 } | 178 } |
| 175 | 179 |
| 176 | 180 |
| 177 } // namespace message_center | 181 } // namespace message_center |
| OLD | NEW |