Index: components/search_engines/template_url_service.h |
diff --git a/components/search_engines/template_url_service.h b/components/search_engines/template_url_service.h |
index dda5de4f3dae0106193e2cc0a8aa2ee84d6e02d4..f93000f5af07d3debfc1b8995fcf36a05bbe3cc1 100644 |
--- a/components/search_engines/template_url_service.h |
+++ b/components/search_engines/template_url_service.h |
@@ -16,6 +16,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/observer_list.h" |
#include "base/prefs/pref_change_registrar.h" |
+#include "base/time/clock.h" |
#include "components/google/core/browser/google_url_tracker.h" |
#include "components/keyed_service/core/keyed_service.h" |
#include "components/search_engines/default_search_manager.h" |
@@ -69,8 +70,6 @@ class TemplateURLService : public WebDataServiceConsumer, |
public: |
typedef std::map<std::string, std::string> QueryTerms; |
typedef std::vector<TemplateURL*> TemplateURLVector; |
- // Type for a static function pointer that acts as a time source. |
- typedef base::Time(TimeProvider)(); |
typedef std::map<std::string, syncer::SyncData> SyncDataMap; |
typedef base::CallbackList<void(void)>::Subscription Subscription; |
@@ -366,11 +365,7 @@ class TemplateURLService : public WebDataServiceConsumer, |
const syncer::SyncDataList& sync_data); |
#if defined(UNIT_TEST) |
- // Sets a different time provider function, such as |
- // base::MockTimeProvider::StaticNow, for testing calls to base::Time::Now. |
- void set_time_provider(TimeProvider* time_provider) { |
- time_provider_ = time_provider; |
- } |
+ void set_clock(scoped_ptr<base::Clock> clock) { clock_ = clock.Pass(); } |
#endif |
private: |
@@ -706,8 +701,8 @@ class TemplateURLService : public WebDataServiceConsumer, |
// increasing integer that is initialized from the database. |
TemplateURLID next_id_; |
- // Function returning current time in base::Time units. |
- TimeProvider* time_provider_; |
+ // Used to retrieve the current time, in base::Time units. |
+ scoped_ptr<base::Clock> clock_; |
// Do we have an active association between the TemplateURLs and sync models? |
// Set in MergeDataAndStartSyncing, reset in StopSyncing. While this is not |