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

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

Issue 10836099: Support for promo_type. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review feedback Created 8 years, 4 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
Index: chrome/browser/web_resource/notification_promo.h
===================================================================
--- chrome/browser/web_resource/notification_promo.h (revision 150023)
+++ chrome/browser/web_resource/notification_promo.h (working copy)
@@ -27,15 +27,19 @@
public:
static GURL PromoServerURL();
- static const char kNtpNotificationPromoType[];
- static const char kBubblePromoType[];
+ enum PromoType {
+ NO_PROMO,
+ NTP_NOTIFICATION_PROMO,
+ BUBBLE_PROMO,
+ MOBILE_NTP_SYNC_PROMO,
+ };
explicit NotificationPromo(Profile* profile);
~NotificationPromo();
// Initialize from json/prefs.
- void InitFromJson(const base::DictionaryValue& json);
- void InitFromPrefs();
+ void InitFromJson(const base::DictionaryValue& json, PromoType promo_type);
+ void InitFromPrefs(PromoType promo_type);
// Can this promo be shown?
bool CanShow() const;
@@ -46,8 +50,11 @@
double EndTime() const;
// Helpers for NewTabPageHandler.
- void HandleClosed();
- bool HandleViewed(); // returns true if views exceeds maximum allowed.
+ // Mark the promo as closed when the user dismisses it.
+ static void HandleClosed(Profile* profile, PromoType promo_type);
+ // Mark the promo has having been viewed. This returns true if views
+ // exceeds the maximum allowed.
+ static bool HandleViewed(Profile* profile, PromoType promo_type);
bool new_notification() const { return new_notification_; }
@@ -91,7 +98,7 @@
Profile* profile_;
PrefService* prefs_;
- std::string promo_type_;
+ PromoType promo_type_;
std::string promo_text_;
#if defined(OS_ANDROID) || defined(OS_IOS)
std::string promo_text_long_;
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.cc ('k') | chrome/browser/web_resource/notification_promo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698