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

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: android x 4 Created 8 years 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..333912555eb6d4c0fd0b5dd938f3199e666da892 100644
--- a/chrome/browser/web_resource/notification_promo.h
+++ b/chrome/browser/web_resource/notification_promo.h
@@ -18,9 +18,8 @@ class DictionaryValue;
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 +34,7 @@ class NotificationPromo {
MOBILE_NTP_SYNC_PROMO,
};
- explicit NotificationPromo(Profile* profile);
+ explicit NotificationPromo(PrefServiceSimple* prefs);
~NotificationPromo();
// Initialize from json/prefs.
@@ -52,10 +51,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(PrefServiceSimple* prefs, 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(PrefServiceSimple* prefs, PromoType promo_type);
bool new_notification() const { return new_notification_; }
@@ -66,6 +65,7 @@ class NotificationPromo {
}
// Register preferences.
+ static void RegisterPrefs(PrefServiceSimple* local_state);
static void RegisterUserPrefs(PrefServiceSyncable* prefs);
private:
@@ -90,11 +90,7 @@ 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_;
+ PrefServiceSimple* prefs_;
PromoType promo_type_;
std::string promo_text_;
@@ -118,8 +114,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