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

Unified Diff: components/search_engines/template_url_data_util.cc

Issue 2498053002: Add field to monitor last visited time for each search engine (Closed)
Patch Set: Update Nit comment. Created 4 years 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
« no previous file with comments | « components/search_engines/template_url_data.cc ('k') | components/search_engines/template_url_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url_data_util.cc
diff --git a/components/search_engines/template_url_data_util.cc b/components/search_engines/template_url_data_util.cc
index 77ad25fd96a71e8695c6704659b1c318e1b62309..be06e2c88b875f5a19ff4cb3de18b4f36617f3f1 100644
--- a/components/search_engines/template_url_data_util.cc
+++ b/components/search_engines/template_url_data_util.cc
@@ -67,18 +67,22 @@ std::unique_ptr<TemplateURLData> TemplateURLDataFromDictionary(
std::string date_created_str;
std::string last_modified_str;
+ std::string last_visited_str;
dict.GetString(DefaultSearchManager::kDateCreated, &date_created_str);
dict.GetString(DefaultSearchManager::kLastModified, &last_modified_str);
+ dict.GetString(DefaultSearchManager::kLastVisited, &last_visited_str);
int64_t date_created = 0;
- if (base::StringToInt64(date_created_str, &date_created)) {
+ if (base::StringToInt64(date_created_str, &date_created))
result->date_created = base::Time::FromInternalValue(date_created);
- }
int64_t last_modified = 0;
- if (base::StringToInt64(date_created_str, &last_modified)) {
+ if (base::StringToInt64(date_created_str, &last_modified))
result->last_modified = base::Time::FromInternalValue(last_modified);
- }
+
+ int64_t last_visited = 0;
+ if (base::StringToInt64(last_visited_str, &last_visited))
+ result->last_visited = base::Time::FromInternalValue(last_visited);
dict.GetInteger(DefaultSearchManager::kUsageCount, &result->usage_count);
@@ -147,6 +151,9 @@ std::unique_ptr<base::DictionaryValue> TemplateURLDataToDictionary(
url_dict->SetString(
DefaultSearchManager::kLastModified,
base::Int64ToString(data.last_modified.ToInternalValue()));
+ url_dict->SetString(
+ DefaultSearchManager::kLastVisited,
+ base::Int64ToString(data.last_visited.ToInternalValue()));
url_dict->SetInteger(DefaultSearchManager::kUsageCount, data.usage_count);
auto alternate_urls = base::MakeUnique<base::ListValue>();
« no previous file with comments | « components/search_engines/template_url_data.cc ('k') | components/search_engines/template_url_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698