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

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

Issue 1395093002: Fix system notifications incorrectly marked as type WEB_PAGE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@timeout
Patch Set: Fix typo Created 5 years, 2 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/notification.cc ('k') | no next file » | 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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_timer.h" 5 #include "ui/message_center/popup_timer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/message_center/message_center_style.h" 9 #include "ui/message_center/message_center_style.h"
10 #include "ui/message_center/message_center_types.h" 10 #include "ui/message_center/message_center_types.h"
11 #include "ui/message_center/notification.h" 11 #include "ui/message_center/notification.h"
12 #include "ui/message_center/notification_list.h" 12 #include "ui/message_center/notification_list.h"
13 13
14 namespace message_center { 14 namespace message_center {
15 15
16 namespace { 16 namespace {
17 17
18 base::TimeDelta GetTimeoutForNotification(Notification* notification) { 18 base::TimeDelta GetTimeoutForNotification(Notification* notification) {
19 if (notification->priority() > message_center::DEFAULT_PRIORITY) 19 if (notification->priority() > DEFAULT_PRIORITY)
20 return base::TimeDelta::FromSeconds(kAutocloseHighPriorityDelaySeconds); 20 return base::TimeDelta::FromSeconds(kAutocloseHighPriorityDelaySeconds);
21 if (notification->is_web_notification()) 21 if (notification->notifier_id().type == NotifierId::WEB_PAGE)
22 return base::TimeDelta::FromSeconds(kAutocloseWebNotificationDelaySeconds); 22 return base::TimeDelta::FromSeconds(kAutocloseWebPageDelaySeconds);
23 return base::TimeDelta::FromSeconds(kAutocloseDefaultDelaySeconds); 23 return base::TimeDelta::FromSeconds(kAutocloseDefaultDelaySeconds);
24 } 24 }
25 25
26 } // namespace 26 } // namespace
27 27
28 //////////////////////////////////////////////////////////////////////////////// 28 ////////////////////////////////////////////////////////////////////////////////
29 // PopupTimer 29 // PopupTimer
30 30
31 PopupTimer::PopupTimer(const std::string& id, 31 PopupTimer::PopupTimer(const std::string& id,
32 base::TimeDelta timeout, 32 base::TimeDelta timeout,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (popup_timers_.find(id) == popup_timers_.end()) 166 if (popup_timers_.find(id) == popup_timers_.end())
167 StartTimer(id, GetTimeoutForNotification(*iter)); 167 StartTimer(id, GetTimeoutForNotification(*iter));
168 } 168 }
169 169
170 void PopupTimersController::OnNotificationRemoved(const std::string& id, 170 void PopupTimersController::OnNotificationRemoved(const std::string& id,
171 bool by_user) { 171 bool by_user) {
172 CancelTimer(id); 172 CancelTimer(id);
173 } 173 }
174 174
175 } // namespace message_center 175 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/notification.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698