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

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

Issue 2094523002: Add migration from old to new NTP Promo pref structure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments Created 4 years, 6 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 | ios/chrome/browser/notification_promo.cc » ('j') | ios/chrome/browser/notification_promo.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/notification_promo.h
diff --git a/ios/chrome/browser/notification_promo.h b/ios/chrome/browser/notification_promo.h
index c1441214498557d2c4013f227b3bf1fc49f4322d..cb535762ace4983c4659397e53b8e2e437476a86 100644
--- a/ios/chrome/browser/notification_promo.h
+++ b/ios/chrome/browser/notification_promo.h
@@ -87,9 +87,12 @@ class NotificationPromo {
// For testing.
friend class NotificationPromoTest;
- // Flush data members to prefs for storage.
+ // Flush data from instance variables to prefs for storage.
void WritePrefs();
+ // Flush given parameters to prefs for storage.
+ void WritePrefs(int promo_id, double first_view_time, int views, bool closed);
+
// Tests views_ against max_views_.
// When max_views_ is 0, we don't cap the number of views.
bool ExceedsMaxViews() const;
@@ -102,6 +105,10 @@ class NotificationPromo {
// payload.
bool IsPayloadParam(const std::string& param_name) const;
+ // Transition data saved in old prefs structure to new structure that supports
+ // storing multiple promos.
+ void MigrateOldPrefs();
+
PrefService* local_state_;
PromoType promo_type_;
« no previous file with comments | « no previous file | ios/chrome/browser/notification_promo.cc » ('j') | ios/chrome/browser/notification_promo.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698