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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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/message_center/popup_timers_controller.h ('k') | ui/message_center/views/bounded_label.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/popup_timers_controller.h" 5 #include "ui/message_center/popup_timers_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "ui/message_center/message_center_style.h" 10 #include "ui/message_center/message_center_style.h"
(...skipping 23 matching lines...) Expand all
34 34
35 void PopupTimersController::StartTimer(const std::string& id, 35 void PopupTimersController::StartTimer(const std::string& id,
36 const base::TimeDelta& timeout) { 36 const base::TimeDelta& timeout) {
37 PopupTimerCollection::const_iterator iter = popup_timers_.find(id); 37 PopupTimerCollection::const_iterator iter = popup_timers_.find(id);
38 if (iter != popup_timers_.end()) { 38 if (iter != popup_timers_.end()) {
39 DCHECK(iter->second); 39 DCHECK(iter->second);
40 iter->second->Start(); 40 iter->second->Start();
41 return; 41 return;
42 } 42 }
43 43
44 scoped_ptr<PopupTimer> timer(new PopupTimer(id, timeout, AsWeakPtr())); 44 std::unique_ptr<PopupTimer> timer(new PopupTimer(id, timeout, AsWeakPtr()));
45 45
46 timer->Start(); 46 timer->Start();
47 popup_timers_.insert(std::make_pair(id, std::move(timer))); 47 popup_timers_.insert(std::make_pair(id, std::move(timer)));
48 } 48 }
49 49
50 void PopupTimersController::StartAll() { 50 void PopupTimersController::StartAll() {
51 for (const auto& iter : popup_timers_) 51 for (const auto& iter : popup_timers_)
52 iter.second->Start(); 52 iter.second->Start();
53 } 53 }
54 54
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (popup_timers_.find(id) == popup_timers_.end()) 117 if (popup_timers_.find(id) == popup_timers_.end())
118 StartTimer(id, GetTimeoutForNotification(*iter)); 118 StartTimer(id, GetTimeoutForNotification(*iter));
119 } 119 }
120 120
121 void PopupTimersController::OnNotificationRemoved(const std::string& id, 121 void PopupTimersController::OnNotificationRemoved(const std::string& id,
122 bool by_user) { 122 bool by_user) {
123 CancelTimer(id); 123 CancelTimer(id);
124 } 124 }
125 125
126 } // namespace message_center 126 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/popup_timers_controller.h ('k') | ui/message_center/views/bounded_label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698