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

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

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: Initial upload. 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.cc
===================================================================
--- chrome/browser/search_engines/template_url_service.cc (revision 90021)
+++ chrome/browser/search_engines/template_url_service.cc (working copy)
@@ -102,7 +102,8 @@
load_handle_(0),
default_search_provider_(NULL),
is_default_search_managed_(false),
- next_id_(1) {
+ next_id_(1),
+ time_provider_(&base::Time::Now) {
DCHECK(profile_);
Init(NULL, 0);
}
@@ -116,7 +117,8 @@
service_(NULL),
default_search_provider_(NULL),
is_default_search_managed_(false),
- next_id_(1) {
+ next_id_(1),
+ time_provider_(&base::Time::Now) {
Init(initializers, count);
}
@@ -399,6 +401,7 @@
new_url.SetURL(search_url, 0, 0);
}
new_url.set_safe_for_autoreplace(false);
+ new_url.set_last_modified(time_provider_());
UpdateNoNotify(url, new_url);
NotifyObservers();
}
@@ -634,6 +637,15 @@
PrefService::UNSYNCABLE_PREF);
}
+void TemplateURLService::InstallTimeProvider(TimeProvider* time_provider) {
sky 2011/06/22 22:38:06 Rename to set_time_provider, inline it and wrap it
SteveT 2011/06/23 21:15:55 Done.
+ DCHECK(time_provider);
+ time_provider_ = time_provider;
+}
+
+void TemplateURLService::UninstallTimeProvider() {
+ time_provider_ = &base::Time::Now;
sky 2011/06/22 22:38:06 Let the tests that care handle this. In fact based
SteveT 2011/06/23 21:15:55 Removed it in favour of managing it with set_time_
+}
+
void TemplateURLService::SetKeywordSearchTermsForURL(const TemplateURL* t_url,
const GURL& url,
const string16& term) {

Powered by Google App Engine
This is Rietveld 408576698