NotificationPromo.
* 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.
Review URL: http://codereview.chromium.org/8045012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103646 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 824e1859..1410cee 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -3841,6 +3841,8 @@
'browser/web_applications/web_app.h',
'browser/web_resource/gpu_blacklist_updater.cc',
'browser/web_resource/gpu_blacklist_updater.h',
+ 'browser/web_resource/notification_promo.cc',
+ 'browser/web_resource/notification_promo.h',
'browser/web_resource/promo_resource_service.cc',
'browser/web_resource/promo_resource_service.h',
'browser/web_resource/web_resource_service.cc',