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

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

Issue 11689004: Move PromoResourceService from Profile to BrowserProcessImpl/local_state(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 12 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
diff --git a/chrome/browser/web_resource/notification_promo.h b/chrome/browser/web_resource/notification_promo.h
index f3b2c5bd8e17b406242cd270f7d4a2b998d32453..f364e783dac1f1cd6f62f3b9f2132bc9b1735137 100644
--- a/chrome/browser/web_resource/notification_promo.h
+++ b/chrome/browser/web_resource/notification_promo.h
@@ -19,8 +19,8 @@ class ListValue;
}
class PrefService;
+class PrefServiceSimple;
class PrefServiceSyncable;
-class Profile;
// Helper class for PromoResourceService that parses promo notification info
// from json or prefs.
@@ -35,7 +35,7 @@ class NotificationPromo {
MOBILE_NTP_SYNC_PROMO,
};
- explicit NotificationPromo(Profile* profile);
+ NotificationPromo();
~NotificationPromo();
// Initialize from json/prefs.
@@ -52,10 +52,10 @@ class NotificationPromo {
// Helpers for NewTabPageHandler.
// Mark the promo as closed when the user dismisses it.
- static void HandleClosed(Profile* profile, PromoType promo_type);
+ static void HandleClosed(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);
+ static bool HandleViewed(PromoType promo_type);
bool new_notification() const { return new_notification_; }
@@ -66,11 +66,21 @@ class NotificationPromo {
}
// Register preferences.
+ static void RegisterPrefs(PrefServiceSimple* local_state);
static void RegisterUserPrefs(PrefServiceSyncable* prefs);
private:
+ static void HandleClosedInternal(NotificationPromo* promo,
+ PromoType promo_type);
+ static bool HandleViewedInternal(NotificationPromo* promo,
+ PromoType promo_type);
+
// For testing.
+ NotificationPromo(PrefService* prefs);
+ static void HandleClosedForTesting(PrefService* prefs, PromoType promo_type);
+ static bool HandleViewedForTesting(PrefService* prefs, PromoType promo_type);
friend class NotificationPromoTest;
Robert Sesek 2013/01/03 21:40:10 friend declarations come first
Dan Beam 2013/01/03 22:47:38 Done. (removed *Internal methods)
+ friend class PromoResourceService;
// Check if this promo notification is new based on start/end times,
// and trigger events accordingly.
@@ -90,10 +100,6 @@ class NotificationPromo {
// When max_views_ is 0, we don't cap the number of views.
bool ExceedsMaxViews() const;
- // True if this promo is not targeted to G+ users, or if this is a G+ user.
- bool IsGPlusRequired() const;
-
- Profile* profile_;
PrefService* prefs_;
PromoType promo_type_;
@@ -118,8 +124,6 @@ class NotificationPromo {
int views_;
bool closed_;
- bool gplus_required_;
-
bool new_notification_;
DISALLOW_COPY_AND_ASSIGN(NotificationPromo);

Powered by Google App Engine
This is Rietveld 408576698