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

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

Issue 8520009: Only show G+ promo for users logged into G+ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
===================================================================
--- chrome/browser/web_resource/notification_promo.h (revision 108876)
+++ chrome/browser/web_resource/notification_promo.h (working copy)
@@ -10,16 +10,22 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "net/url_request/url_request_context.h"
achuithb 2011/11/16 23:27:03 Shouldn't this be in the cc file? You're forward d
Cait (Slow) 2011/11/17 00:05:59 Done.
namespace base {
class DictionaryValue;
}
+namespace net {
+ class URLRequestContextGetter;
+}
+
class PrefService;
-
+class Profile;
// Helper class for PromoResourceService that parses promo notification info
achuithb 2011/11/16 23:27:03 newline above this line please.
Cait (Slow) 2011/11/17 00:05:59 Done.
// from json or prefs.
-class NotificationPromo {
+class NotificationPromo
+ : public base::RefCountedThreadSafe<NotificationPromo> {
public:
class Delegate {
public:
@@ -29,8 +35,10 @@
virtual bool IsBuildAllowed(int builds_targeted) const { return false; }
};
- explicit NotificationPromo(PrefService* prefs, Delegate* delegate);
+ // Static factory for creating new promo objects.
achuithb 2011/11/16 23:27:03 Perhaps change this to 'Static factory for creatin
Cait (Slow) 2011/11/17 00:05:59 Done.
+ static NotificationPromo* Factory(Profile* profile, Delegate* delegate);
+
// Initialize from json/prefs.
void InitFromJson(const base::DictionaryValue& json);
void InitFromPrefs();
@@ -49,7 +57,14 @@
// Register preferences.
static void RegisterUserPrefs(PrefService* prefs);
+ protected:
achuithb 2011/11/16 23:27:03 Remove these lines
Cait (Slow) 2011/11/17 00:05:59 Done.
+
+
private:
+ friend class base::RefCountedThreadSafe<NotificationPromo>;
+ NotificationPromo(Profile* profile, Delegate* delegate);
+ virtual ~NotificationPromo();
+
// For testing.
friend class NotificationPromoTestDelegate;
FRIEND_TEST_ALL_PREFIXES(PromoResourceServiceTest, GetNextQuestionValueTest);
@@ -70,11 +85,15 @@
// Check if this promo notification is new based on start/end times,
// and trigger events accordingly.
- void CheckForNewNotification();
+ void CheckForNewNotification(bool found_cookie);
// Actions on receiving a new promo notification.
void OnNewNotification();
+ void GetCookiesCallback(const std::string& cookies);
achuithb 2011/11/16 23:27:03 Switch the order of GetCookies and GetCookiesCallb
Cait (Slow) 2011/11/17 00:05:59 Done.
+
+ void GetCookies(net::URLRequestContextGetter* getter);
+
// Create a new promo notification group.
static int NewGroup();
@@ -94,6 +113,7 @@
// For testing.
bool operator==(const NotificationPromo& other) const;
+ Profile* profile_;
PrefService* prefs_;
Delegate* delegate_;
@@ -104,11 +124,13 @@
int time_slice_;
int max_group_;
int max_views_;
+ int feature_mask_;
int group_;
int views_;
std::string text_;
bool closed_;
+ bool gplus_;
DISALLOW_COPY_AND_ASSIGN(NotificationPromo);
};
« no previous file with comments | « no previous file | chrome/browser/web_resource/notification_promo.cc » ('j') | chrome/browser/web_resource/notification_promo.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698