diff options
author | cmp@chromium.org <cmp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 20:42:53 +0000 |
---|---|---|
committer | cmp@chromium.org <cmp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 20:42:53 +0000 |
commit | 8fda0ab08a219c0d96e3d51d26479d10f386ee30 (patch) | |
tree | fc16acfbfebd0795629f7e4c87e0500258566cfc /chrome/browser/web_resource/promo_resource_service.h | |
parent | 38b8971cd5d5a9481d571d7bfca44a06566111d5 (diff) | |
download | chromium_src-8fda0ab08a219c0d96e3d51d26479d10f386ee30.zip chromium_src-8fda0ab08a219c0d96e3d51d26479d10f386ee30.tar.gz chromium_src-8fda0ab08a219c0d96e3d51d26479d10f386ee30.tar.bz2 |
Revert 80318 - Detach the PromoResourceService and WebResourceService from the Profile; have them store web resource data in local state instead.
We don't need multiple services for different Profiles; instead, there is a single service that captures data in local_state. The only preference stored in the Profile about the promo will be a bool indicating whether it's been closed or not, which will now be set outside the service.
Reviewers:
arv for general changes to PromoResourceService, & unittest.
erg for pulling the service out of the Profile and serving it up as a Singleton.
zmo for the changes I made to gpu_data_manager.
jstritar FYI, for changes to the PromoResourceService.
BUG=77155
TEST=promo resource service unittests.
Review URL: http://codereview.chromium.org/6736028
TBR=mirandac@chromium.org
Review URL: http://codereview.chromium.org/6677140
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_resource/promo_resource_service.h')
-rw-r--r-- | chrome/browser/web_resource/promo_resource_service.h | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/chrome/browser/web_resource/promo_resource_service.h b/chrome/browser/web_resource/promo_resource_service.h index 3155b52..733e6ae 100644 --- a/chrome/browser/web_resource/promo_resource_service.h +++ b/chrome/browser/web_resource/promo_resource_service.h @@ -8,16 +8,13 @@ #include "chrome/browser/web_resource/web_resource_service.h" -class Profile; -class PromoResourceServiceTest; - -namespace web_resource { +namespace PromoResourceServiceUtil { // Certain promotions should only be shown to certain classes of users. This // function will change to reflect each kind of promotion. bool CanShowPromo(Profile* profile); -} // namespace web_resource +} // namespace PromoResourceServiceUtil // A PromoResourceService fetches data from a web resource server to be used to // dynamically change the appearance of the New Tab Page. For example, it has @@ -30,7 +27,7 @@ bool CanShowPromo(Profile* profile); class PromoResourceService : public WebResourceService { public: - PromoResourceService(); + explicit PromoResourceService(Profile* profile); // Unpack the web resource as a custom promo signal. Expects a start and end // signal, with the promo to be shown in the tooltip of the start signal @@ -68,8 +65,7 @@ class PromoResourceService // For "promo_start", the promotional line itself is given in the "tooltip" // field. The "question" field gives the type of builds that should be shown // this promo (see the BuildType enum in web_resource_service.cc) and the - // number of hours that each promo group should see it, separated by ":": - // BuildType bitmask : time slice in hours + // number of hours that each promo group should see it, separated by ":". // For example, "7:24" would indicate that all builds should see the promo, // and each group should see it for 24 hours. // @@ -109,8 +105,6 @@ class PromoResourceService static const char* kDefaultPromoResourceServer; private: - friend class PromoResourceServiceTest; - virtual ~PromoResourceService(); virtual void Unpack(const DictionaryValue& parsed_json); @@ -125,9 +119,6 @@ class PromoResourceService // can write resource data back to user's pref file. DictionaryValue* web_resource_cache_; - // Saved for use in unit testing. - int promo_group_; - DISALLOW_COPY_AND_ASSIGN(PromoResourceService); }; |