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

Unified Diff: ui/message_center/popup_timers_controller.cc

Issue 2315513002: Reset popup dismissal timers when replacing a notification. (Closed)
Patch Set: Reset popup dismissal timers when replacing a notification. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/popup_timers_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/popup_timers_controller.cc
diff --git a/ui/message_center/popup_timers_controller.cc b/ui/message_center/popup_timers_controller.cc
index f0d0652dbd724912a30fce6fabb0625a88ea1253..aae50daf81b5d56a6449febf8e4fc49af2f5009e 100644
--- a/ui/message_center/popup_timers_controller.cc
+++ b/ui/message_center/popup_timers_controller.cc
@@ -52,19 +52,6 @@ void PopupTimersController::StartAll() {
iter.second->Start();
}
-void PopupTimersController::ResetTimer(const std::string& id,
- const base::TimeDelta& timeout) {
- CancelTimer(id);
- StartTimer(id, timeout);
-}
-
-void PopupTimersController::PauseTimer(const std::string& id) {
- PopupTimerCollection::const_iterator iter = popup_timers_.find(id);
- if (iter == popup_timers_.end())
- return;
- iter->second->Pause();
-}
-
void PopupTimersController::PauseAll() {
for (const auto& iter : popup_timers_)
iter.second->Pause();
@@ -113,9 +100,8 @@ void PopupTimersController::OnNotificationUpdated(const std::string& id) {
return;
}
- // Start the timer if not yet.
- if (popup_timers_.find(id) == popup_timers_.end())
- StartTimer(id, GetTimeoutForNotification(*iter));
+ CancelTimer(id);
+ StartTimer(id, GetTimeoutForNotification(*iter));
}
void PopupTimersController::OnNotificationRemoved(const std::string& id,
« no previous file with comments | « ui/message_center/popup_timers_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698