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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 void ChangeQueue::UpdateNotification(const std::string& old_id, | 189 void ChangeQueue::UpdateNotification(const std::string& old_id, |
190 scoped_ptr<Notification> notification) { | 190 scoped_ptr<Notification> notification) { |
191 std::string new_id = notification->id(); | 191 std::string new_id = notification->id(); |
192 scoped_ptr<Change> change( | 192 scoped_ptr<Change> change( |
193 new Change(CHANGE_TYPE_UPDATE, new_id, notification.Pass())); | 193 new Change(CHANGE_TYPE_UPDATE, new_id, notification.Pass())); |
194 Replace(old_id, change.Pass()); | 194 Replace(old_id, change.Pass()); |
195 } | 195 } |
196 | 196 |
197 void ChangeQueue::EraseNotification(const std::string& id, bool by_user) { | 197 void ChangeQueue::EraseNotification(const std::string& id, bool by_user) { |
198 scoped_ptr<Change> change( | 198 scoped_ptr<Change> change(new Change(CHANGE_TYPE_DELETE, id, nullptr)); |
199 new Change(CHANGE_TYPE_DELETE, id, scoped_ptr<Notification>())); | |
200 change->set_by_user(by_user); | 199 change->set_by_user(by_user); |
201 Replace(id, change.Pass()); | 200 Replace(id, change.Pass()); |
202 } | 201 } |
203 | 202 |
204 bool ChangeQueue::Has(const std::string& id) const { | 203 bool ChangeQueue::Has(const std::string& id) const { |
205 ScopedVector<Change>::const_iterator iter = | 204 ScopedVector<Change>::const_iterator iter = |
206 std::find_if(changes_.begin(), changes_.end(), ChangeFinder(id)); | 205 std::find_if(changes_.begin(), changes_.end(), ChangeFinder(id)); |
207 return iter != changes_.end(); | 206 return iter != changes_.end(); |
208 } | 207 } |
209 | 208 |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 void MessageCenterImpl::PausePopupTimers() { | 877 void MessageCenterImpl::PausePopupTimers() { |
879 if (popup_timers_controller_) | 878 if (popup_timers_controller_) |
880 popup_timers_controller_->PauseAll(); | 879 popup_timers_controller_->PauseAll(); |
881 } | 880 } |
882 | 881 |
883 void MessageCenterImpl::DisableTimersForTest() { | 882 void MessageCenterImpl::DisableTimersForTest() { |
884 popup_timers_controller_.reset(); | 883 popup_timers_controller_.reset(); |
885 } | 884 } |
886 | 885 |
887 } // namespace message_center | 886 } // namespace message_center |
OLD | NEW |