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

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: edits 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') | no next file with comments »
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..d05a69987f0e2c031f96a91abf27350d1416ee13 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,12 @@ 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.
+ // TODO(crbug.com/623726) Remove this method when migration is no longer
+ // needed as most users have been upgraded to the new pref structure.
+ void MigrateOldPrefs();
+
PrefService* local_state_;
PromoType promo_type_;
« no previous file with comments | « no previous file | ios/chrome/browser/notification_promo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698