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

Unified Diff: chrome/browser/web_resource/promo_resource_service.cc

Issue 10496008: Purge legacy notification promo code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/promo_resource_service.cc
===================================================================
--- chrome/browser/web_resource/promo_resource_service.cc (revision 140104)
+++ chrome/browser/web_resource/promo_resource_service.cc (working copy)
@@ -149,13 +149,6 @@
UnpackWebStoreSignal(parsed_json);
}
-void PromoResourceService::OnNotificationParsed(double start, double end,
- bool new_notification) {
- if (new_notification) {
- ScheduleNotification(start, end);
- }
-}
-
void PromoResourceService::ScheduleNotification(double promo_start,
double promo_end) {
if (promo_start > 0 && promo_end > 0) {
@@ -234,16 +227,19 @@
void PromoResourceService::UnpackNotificationSignal(
const DictionaryValue& parsed_json) {
- scoped_refptr<NotificationPromo> notification_promo =
- NotificationPromo::Create(profile_, this);
- notification_promo->InitFromJson(parsed_json);
+ NotificationPromo notification_promo(profile_);
+ notification_promo.InitFromJson(parsed_json);
+
+ if (notification_promo.new_notification()) {
+ ScheduleNotification(notification_promo.StartTimeForGroup(),
+ notification_promo.EndTime());
+ }
}
bool PromoResourceService::CanShowNotificationPromo(Profile* profile) {
- scoped_refptr<NotificationPromo> notification_promo =
- NotificationPromo::Create(profile, NULL);
- notification_promo->InitFromPrefs();
- return notification_promo->CanShow();
+ NotificationPromo notification_promo(profile);
+ notification_promo.InitFromPrefs();
+ return notification_promo.CanShow();
}
void PromoResourceService::UnpackWebStoreSignal(
Dan Beam 2012/06/04 18:41:04 if we're not using the tips server, how is any of
achuithb 2012/06/04 19:52:59 Chatted about this; Tips server continues to be us

Powered by Google App Engine
This is Rietveld 408576698