Index: chrome/browser/web_resource/promo_resource_service.cc |
diff --git a/chrome/browser/web_resource/promo_resource_service.cc b/chrome/browser/web_resource/promo_resource_service.cc |
index fbdeab1e7eec2f62f481167bcfe7315f58fbffe7..a1113a135d4a34592a5d199ae2165f2faaff5edb 100644 |
--- a/chrome/browser/web_resource/promo_resource_service.cc |
+++ b/chrome/browser/web_resource/promo_resource_service.cc |
@@ -150,14 +150,16 @@ void PromoResourceService::ScheduleNotification(double promo_start, |
int64 ms_until_end = |
static_cast<int64>((base::Time::FromDoubleT( |
promo_end) - base::Time::Now()).InMilliseconds()); |
- if (ms_until_start > 0) |
+ if (ms_until_start > 0) { |
+ // Schedule the next notification to happen at the start of promotion. |
PostNotification(ms_until_start); |
- if (ms_until_end > 0) { |
- PostNotification(ms_until_end); |
+ } else if (ms_until_end > 0) { |
if (ms_until_start <= 0) { |
// Notify immediately if time is between start and end. |
PostNotification(0); |
} |
+ // Schedule the next notification to happen at the end of promotion. |
+ PostNotification(ms_until_end); |
} |
} |
} |