Chromium Code Reviews| 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_; |