Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: ui/message_center/message_center_impl.cc

Issue 855023003: Add presubmit check for scoped_ptr usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_surface_egl.cc ('k') | ui/message_center/views/message_center_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_egl.cc ('k') | ui/message_center/views/message_center_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698