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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 | 140 |
141 void MessageCenter::ShowNotificationSettings(const std::string& id) { | 141 void MessageCenter::ShowNotificationSettings(const std::string& id) { |
142 if (delegate_) | 142 if (delegate_) |
143 delegate_->ShowSettings(id); | 143 delegate_->ShowSettings(id); |
144 } | 144 } |
145 | 145 |
146 void MessageCenter::OnNotificationClicked(const std::string& id) { | 146 void MessageCenter::OnNotificationClicked(const std::string& id) { |
147 if (delegate_) | 147 if (delegate_) |
148 delegate_->OnClicked(id); | 148 delegate_->OnClicked(id); |
| 149 if (HasPopupNotifications()) { |
| 150 notification_list_->MarkSinglePopupAsShown(id); |
| 151 NotifyMessageCenterChanged(false); |
| 152 } |
149 } | 153 } |
150 | 154 |
151 void MessageCenter::OnQuietModeChanged(bool quiet_mode) { | 155 void MessageCenter::OnQuietModeChanged(bool quiet_mode) { |
152 NotifyMessageCenterChanged(true); | 156 NotifyMessageCenterChanged(true); |
153 } | 157 } |
154 | 158 |
155 void MessageCenter::OnButtonClicked(const std::string& id, int button_index) { | 159 void MessageCenter::OnButtonClicked(const std::string& id, int button_index) { |
156 if (delegate_) | 160 if (delegate_) |
157 delegate_->OnButtonClicked(id, button_index); | 161 delegate_->OnButtonClicked(id, button_index); |
158 } | 162 } |
(...skipping 15 matching lines...) Expand all Loading... |
174 } | 178 } |
175 | 179 |
176 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { | 180 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { |
177 FOR_EACH_OBSERVER(Observer, | 181 FOR_EACH_OBSERVER(Observer, |
178 observer_list_, | 182 observer_list_, |
179 OnMessageCenterChanged(new_notification)); | 183 OnMessageCenterChanged(new_notification)); |
180 } | 184 } |
181 | 185 |
182 | 186 |
183 } // namespace message_center | 187 } // namespace message_center |
OLD | NEW |