Chromium Code Reviews| Index: ui/message_center/popup_timer.cc |
| diff --git a/ui/message_center/popup_timer.cc b/ui/message_center/popup_timer.cc |
| index aa45d06d43cbdfbd1aa452fa0e4bd61731a3bd2c..4540f44ef2a0fedfe40aa07abafb6a104221a387 100644 |
| --- a/ui/message_center/popup_timer.cc |
| +++ b/ui/message_center/popup_timer.cc |
| @@ -11,21 +11,23 @@ |
| #include "ui/message_center/notification.h" |
| #include "ui/message_center/notification_list.h" |
| +namespace message_center { |
| + |
| namespace { |
| -base::TimeDelta GetTimeoutForPriority(int priority) { |
| - if (priority > message_center::DEFAULT_PRIORITY) { |
| - return base::TimeDelta::FromSeconds( |
| - message_center::kAutocloseHighPriorityDelaySeconds); |
| +base::TimeDelta GetTimeoutForNotification(Notification* notification) { |
| + if (notification->priority() > message_center::DEFAULT_PRIORITY) |
| + return base::TimeDelta::FromSeconds(kAutocloseHighPriorityDelaySeconds); |
| + if (notification->is_web_notification()) { |
| + // Web notifications use a larger timeout, which improves re-engagement. |
| + // TODO(johnme): Use Finch to experiment with different values. |
| + return base::TimeDelta::FromSeconds(20); |
|
dewittj
2015/10/07 17:56:40
please add a constant to message_center_style.h in
johnme
2015/10/07 18:18:06
Done.
|
| } |
| - return base::TimeDelta::FromSeconds( |
| - message_center::kAutocloseDefaultDelaySeconds); |
| + return base::TimeDelta::FromSeconds(kAutocloseDefaultDelaySeconds); |
| } |
| } // namespace |
| -namespace message_center { |
| - |
| //////////////////////////////////////////////////////////////////////////////// |
| // PopupTimer |
| @@ -165,7 +167,7 @@ void PopupTimersController::OnNotificationUpdated(const std::string& id) { |
| // Start the timer if not yet. |
| if (popup_timers_.find(id) == popup_timers_.end()) |
| - StartTimer(id, GetTimeoutForPriority((*iter)->priority())); |
| + StartTimer(id, GetTimeoutForNotification(*iter)); |
| } |
| void PopupTimersController::OnNotificationRemoved(const std::string& id, |