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

Unified Diff: components/search_engines/template_url_fetcher.cc

Issue 2498053002: Add field to monitor last visited time for each search engine (Closed)
Patch Set: Add unit test for last_visited field. Created 4 years, 1 month 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: components/search_engines/template_url_fetcher.cc
diff --git a/components/search_engines/template_url_fetcher.cc b/components/search_engines/template_url_fetcher.cc
index cf972d0eeb915643151d183a8757c22f6fabeb78..1edc22d5601c0ef1458aee617b18994fb0eb416a 100644
--- a/components/search_engines/template_url_fetcher.cc
+++ b/components/search_engines/template_url_fetcher.cc
@@ -149,6 +149,7 @@ void TemplateURLFetcher::RequestDelegate::AddSearchProvider() {
TemplateURL* existing_url = NULL;
if (!model->CanAddAutogeneratedKeyword(keyword_, GURL(template_url_->url()),
&existing_url)) {
+ model->UpdateTemplateURLVisitTime(existing_url);
Peter Kasting 2016/11/21 03:35:08 I don't think the changes in this file are the rig
ltian 2016/11/28 22:08:02 Thanks for the info, Peter. Originally I was tryin
fetcher_->RequestCompleted(this); // WARNING: Deletes us!
return;
}
@@ -201,11 +202,13 @@ void TemplateURLFetcher::ScheduleDownload(
return;
}
- const TemplateURL* template_url =
+ TemplateURL* template_url =
template_url_service_->GetTemplateURLForKeyword(keyword);
if (template_url && (!template_url->safe_for_autoreplace() ||
- template_url->originating_url() == osdd_url))
+ template_url->originating_url() == osdd_url)) {
+ template_url_service_->UpdateTemplateURLVisitTime(template_url);
return;
+ }
// Make sure we aren't already downloading this request.
for (const auto& request : requests_) {

Powered by Google App Engine
This is Rietveld 408576698