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

Side by Side Diff: components/search_engines/template_url_prepopulate_data.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/search_engines/template_url_prepopulate_data.h" 5 #include "components/search_engines/template_url_prepopulate_data.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) 7 #if defined(OS_POSIX) && !defined(OS_MACOSX)
8 #include <locale.h> 8 #include <locale.h>
9 #endif 9 #endif
10 10
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 data->contextual_search_url = contextual_search_url.as_string(); 1006 data->contextual_search_url = contextual_search_url.as_string();
1007 data->search_url_post_params = search_url_post_params.as_string(); 1007 data->search_url_post_params = search_url_post_params.as_string();
1008 data->suggestions_url_post_params = suggest_url_post_params.as_string(); 1008 data->suggestions_url_post_params = suggest_url_post_params.as_string();
1009 data->instant_url_post_params = instant_url_post_params.as_string(); 1009 data->instant_url_post_params = instant_url_post_params.as_string();
1010 data->image_url_post_params = image_url_post_params.as_string(); 1010 data->image_url_post_params = image_url_post_params.as_string();
1011 data->favicon_url = GURL(favicon_url); 1011 data->favicon_url = GURL(favicon_url);
1012 data->safe_for_autoreplace = true; 1012 data->safe_for_autoreplace = true;
1013 data->input_encodings.push_back(encoding.as_string()); 1013 data->input_encodings.push_back(encoding.as_string());
1014 data->date_created = base::Time(); 1014 data->date_created = base::Time();
1015 data->last_modified = base::Time(); 1015 data->last_modified = base::Time();
1016 data->last_visited = base::Time();
Peter Kasting 2016/11/21 03:35:08 Nit: See comments in settings_overrides_api.cc
ltian 2016/11/28 22:08:02 Done.
1016 data->prepopulate_id = id; 1017 data->prepopulate_id = id;
1017 for (size_t i = 0; i < alternate_urls.GetSize(); ++i) { 1018 for (size_t i = 0; i < alternate_urls.GetSize(); ++i) {
1018 std::string alternate_url; 1019 std::string alternate_url;
1019 alternate_urls.GetString(i, &alternate_url); 1020 alternate_urls.GetString(i, &alternate_url);
1020 DCHECK(!alternate_url.empty()); 1021 DCHECK(!alternate_url.empty());
1021 data->alternate_urls.push_back(alternate_url); 1022 data->alternate_urls.push_back(alternate_url);
1022 } 1023 }
1023 data->search_terms_replacement_key = search_terms_replacement_key.as_string(); 1024 data->search_terms_replacement_key = search_terms_replacement_key.as_string();
1024 return data; 1025 return data;
1025 } 1026 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 locale_str.erase(0, territory_delim + 1); 1262 locale_str.erase(0, territory_delim + 1);
1262 1263
1263 // Next remove any codeset/modifier portion and uppercase. 1264 // Next remove any codeset/modifier portion and uppercase.
1264 return CountryStringToCountryID( 1265 return CountryStringToCountryID(
1265 base::ToUpperASCII(locale_str.substr(0, locale_str.find_first_of(".@")))); 1266 base::ToUpperASCII(locale_str.substr(0, locale_str.find_first_of(".@"))));
1266 } 1267 }
1267 1268
1268 #endif // OS_* 1269 #endif // OS_*
1269 1270
1270 } // namespace TemplateURLPrepopulateData 1271 } // namespace TemplateURLPrepopulateData
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698