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

Unified Diff: chrome/browser/search_engines/template_url_service.h

Issue 7232023: Added last_modified field to TemplateURL and database. Updated unit tests, including refactoring ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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/search_engines/template_url_service.h
===================================================================
--- chrome/browser/search_engines/template_url_service.h (revision 90021)
+++ chrome/browser/search_engines/template_url_service.h (working copy)
@@ -62,6 +62,8 @@
public:
typedef std::map<std::string, std::string> QueryTerms;
typedef std::vector<const TemplateURL*> TemplateURLVector;
+ // Type for a static function pointer that acts as a time source.
+ typedef base::Time(TimeProvider)();
// Struct used for initializing the data store with fake data.
// Each initializer is mapped to a TemplateURL.
@@ -240,6 +242,14 @@
// Registers the preferences used to save a TemplateURL to prefs.
static void RegisterUserPrefs(PrefService* prefs);
+#if defined(UNIT_TEST)
+ // Set a different time provider function, such as
+ // base::MockTimeProvider::StaticNow, when testing calls to base::Time::Now.
+ void set_time_provider(TimeProvider* time_provider) {
+ time_provider_ = time_provider;
+ }
+#endif
+
protected:
// Cover method for the method of the same name on the HistoryService.
// url is the one that was visited with the given search terms.
@@ -440,6 +450,9 @@
// List of extension IDs waiting for Load to have keywords registered.
std::vector<std::string> pending_extension_ids_;
+ // Function returning current time in base::Time units.
+ TimeProvider* time_provider_;
+
DISALLOW_COPY_AND_ASSIGN(TemplateURLService);
};
« no previous file with comments | « chrome/browser/search_engines/template_url_prepopulate_data.cc ('k') | chrome/browser/search_engines/template_url_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698