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

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: 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,9 @@
double EndTime() const;
// Helpers for NewTabPageHandler.
- void HandleClosed();
- bool HandleViewed(); // returns true if views exceeds maximum allowed.
+ static void HandleClosed(Profile* profile, PromoType promo_type);
Robert Sesek 2012/08/06 21:21:44 Should document what this function does.
achuithb 2012/08/06 22:16:19 Done.
+ // Returns true if views exceeds maximum allowed.
+ static bool HandleViewed(Profile* profile, PromoType promo_type);
bool new_notification() const { return new_notification_; }
@@ -91,7 +96,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_;

Powered by Google App Engine
This is Rietveld 408576698