diff options
Diffstat (limited to 'chrome/browser/web_resource/web_resource_service.h')
-rw-r--r-- | chrome/browser/web_resource/web_resource_service.h | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/chrome/browser/web_resource/web_resource_service.h b/chrome/browser/web_resource/web_resource_service.h index fd46e76..835c5fc 100644 --- a/chrome/browser/web_resource/web_resource_service.h +++ b/chrome/browser/web_resource/web_resource_service.h @@ -28,29 +28,6 @@ class WebResourceService // the process that will parse the JSON, and then update the cache. void UpdateResourceCache(const std::string& json_data); - static const char* kCurrentTipPrefName; - static const char* kTipCachePrefName; - static const char* kCustomLogoId; - - // Default server from which to gather resources. - static const char* kDefaultResourceServer; - - private: - class WebResourceFetcher; - friend class WebResourceFetcher; - - class UnpackerClient; - - ~WebResourceService(); - - void Init(); - - // Set in_fetch_ to false, clean up temp directories (in the future). - void EndFetch(); - - // Puts parsed json data in the right places, and writes to prefs file. - void OnWebResourceUnpacked(const DictionaryValue& parsed_json); - // Unpack the web resource as a set of tips. Expects json in the form of: // { // "lang": "en", @@ -68,6 +45,7 @@ class WebResourceService // } // } // + // Public for unit testing. void UnpackTips(const DictionaryValue& parsed_json); // Unpack the web resource as a custom logo signal. Expects json in the form @@ -76,15 +54,39 @@ class WebResourceService // "topic": { // "answers": [ // { - // "logo_id": "1" + // "custom_logo_start": "31/12/10 01:00", + // "custom_logo_end": "31/01/11 01:00" // }, // ... // ] // } // } // + // Public for unit testing. void UnpackLogoSignal(const DictionaryValue& parsed_json); + static const char* kCurrentTipPrefName; + static const char* kTipCachePrefName; + + // Default server from which to gather resources. + static const char* kDefaultResourceServer; + + private: + class WebResourceFetcher; + friend class WebResourceFetcher; + + class UnpackerClient; + + ~WebResourceService(); + + void Init(); + + // Set in_fetch_ to false, clean up temp directories (in the future). + void EndFetch(); + + // Puts parsed json data in the right places, and writes to prefs file. + void OnWebResourceUnpacked(const DictionaryValue& parsed_json); + // We need to be able to load parsed resource data into preferences file, // and get proper install directory. PrefService* prefs_; @@ -108,8 +110,8 @@ class WebResourceService // Delay on first fetch so we don't interfere with startup. static const int kStartResourceFetchDelay = 5000; - // Delay between calls to update the cache (12 hours). - static const int kCacheUpdateDelay = 12 * 60 * 60 * 1000; + // Delay between calls to update the cache (48 hours). + static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000; DISALLOW_COPY_AND_ASSIGN(WebResourceService); }; |