Index: chrome/browser/web_resource/notification_promo.cc |
=================================================================== |
--- chrome/browser/web_resource/notification_promo.cc (revision 145631) |
+++ chrome/browser/web_resource/notification_promo.cc (working copy) |
@@ -144,11 +144,11 @@ |
grouping->GetInteger("increment_frequency", &time_slice_); |
grouping->GetInteger("increment_max", &max_group_); |
- DVLOG(1) << "num_groups_=" << num_groups_; |
- DVLOG(1) << "initial_segment_ = " << initial_segment_; |
- DVLOG(1) << "increment_ = " << increment_; |
- DVLOG(1) << "time_slice_ = " << time_slice_; |
- DVLOG(1) << "max_group_ = " << max_group_; |
+ DVLOG(1) << "num_groups_ = " << num_groups_ |
+ << ", initial_segment_ = " << initial_segment_ |
+ << ", increment_ = " << increment_ |
+ << ", time_slice_ = " << time_slice_ |
+ << ", max_group_ = " << max_group_; |
} |
// Payload. |
@@ -283,7 +283,7 @@ |
bool NotificationPromo::CanShow() const { |
return !closed_ && |
!promo_text_.empty() && |
- group_ < max_group_ && |
+ !ExceedsMaxGroup() && |
!ExceedsMaxViews() && |
base::Time::FromDoubleT(StartTimeForGroup()) < base::Time::Now() && |
base::Time::FromDoubleT(EndTime()) > base::Time::Now() && |
@@ -307,6 +307,10 @@ |
return ExceedsMaxViews(); |
} |
+bool NotificationPromo::ExceedsMaxGroup() const { |
+ return (max_group_ == 0) ? false : group_ >= max_group_; |
+} |
+ |
bool NotificationPromo::ExceedsMaxViews() const { |
return (max_views_ == 0) ? false : views_ >= max_views_; |
} |