DescriptionNotificationPromo.
* Split out NotificationPromo helper class for PromoResourceService to handle promo notification.
* Support for views/max_views.
* NotificationPromo has data members for all the prefs fields (start, end, build, time_slice,
max_group, max_views, group, views, text and closed).
* Move notification parsing methods from PromoResourceService to NotificationPromo.
* NotificationPromo can be initialized from json when the promo resource is parsed, or from prefs,
when CanShowNotificationPromo is called.
* NotificationPromo now only writes out prefs upon detecting a new notification.
* NotificationPromo has a Delegate class, useful for testing.
* Static helper methods introduced for extracting time from DictionaryValue, string and prefs.
These may be easily unit-tested in the future.
* Number of additional tests to more thoroughly test parsing, CanShow logic, and static helper
functions like GetNextQuestionValue and NewGroup.
* NewGroup now uses RandInt instead of rand(), so this CL passes lint with no complaints.
* Some additional cleanup of PromoResourceService, esp GetChannel and IsBuildTargeted.
BUG=96290
TEST=Unit tests pass. Use
--promo-server-url='http://achuithz600.mtv.corp.google.com/www/files/promoresource2?hl='
to see the promo. If you exceed 5 views, you have to reset the views count (ntp.promo_views)
in your Preferences.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=103646
Patch Set 1 #Patch Set 2 : Integrate PromoNotification into PromoResourceService #Patch Set 3 : Few more tests + fixes #Patch Set 4 : TestTime unit test #Patch Set 5 : chrome_browser.gypi #Patch Set 6 : '' #Patch Set 7 : Support for promoNotificationViewed in new_tab.js and handler #Patch Set 8 : rebase #
Total comments: 15
Patch Set 9 : fix spacing nit #
Total comments: 14
Patch Set 10 : Fixes based on mirandac feedback #Patch Set 11 : minor #
Total comments: 10
Patch Set 12 : Fixes from jstritar feedback #Patch Set 13 : Rename PromoNotification->NotificationPromo and promo_notification->notification_promo #Patch Set 14 : Rename files to notification_promo.[h|cc] #Messages
Total messages: 13 (0 generated)
|