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

Unified Diff: chrome/browser/web_resource/notification_promo.h

Issue 419033007: Limit the window of time a promo can be visible after first view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « no previous file | chrome/browser/web_resource/notification_promo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_resource/notification_promo.h
diff --git a/chrome/browser/web_resource/notification_promo.h b/chrome/browser/web_resource/notification_promo.h
index 3355909ae44bcc19c6ec413cc156875adf0474da..2df1e44941e22d66f48dbc0ce322c430e4666c8c 100644
--- a/chrome/browser/web_resource/notification_promo.h
+++ b/chrome/browser/web_resource/notification_promo.h
@@ -96,6 +96,10 @@ class NotificationPromo {
// When max_views_ is 0, we don't cap the number of views.
bool ExceedsMaxViews() const;
+ // Tests |first_view_time_| + |max_seconds_| and -now().
+ // When either is 0, we don't cap the number of seconds.
+ bool ExceedsMaxSeconds() const;
+
// Returns false if this promo should not be displayed because it is a promo
// for the app launcher, and the user has already enabled the app launcher.
bool CheckAppLauncher() const;
@@ -119,6 +123,13 @@ class NotificationPromo {
// When max_views_ is 0, we don't cap the number of views.
int max_views_;
+ // When max_seconds_ is 0 or not set, we don't cap the number of seconds a
+ // promo can be visible.
+ int max_seconds_;
+
+ // Set when the promo is viewed for the first time.
+ double first_view_time_;
+
int group_;
int views_;
bool closed_;
« no previous file with comments | « no previous file | chrome/browser/web_resource/notification_promo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698