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

Unified Diff: chrome/browser/importer/profile_writer.cc

Issue 2487633003: Change behaivor to decide whether a search engine should be shown in the default list (Closed)
Patch Set: Update based on Peter and Nicolas's comments. 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: chrome/browser/importer/profile_writer.cc
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index 1d5ee8087f4bbc895a6f0aca8fc661ad87eefd25..585b241577f05e6f6166b29c01a2f9819f35a5b6 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -301,14 +301,14 @@ static void BuildHostPathMap(TemplateURLService* model,
template_urls[i], model->search_terms_data(), false);
if (!host_path.empty()) {
const TemplateURL* existing_turl = (*host_path_map)[host_path];
- if (!existing_turl ||
- (template_urls[i]->show_in_default_list() &&
- !existing_turl->show_in_default_list())) {
+ TemplateURL* t_url = template_urls[i];
+ if (!existing_turl || (model->ShowInDefaultList(t_url) &&
+ !model->ShowInDefaultList(existing_turl))) {
// If there are multiple TemplateURLs with the same host+path, favor
// those shown in the default list. If there are multiple potential
// defaults, favor the first one, which should be the more commonly used
// one.
- (*host_path_map)[host_path] = template_urls[i];
+ (*host_path_map)[host_path] = t_url;
}
} // else case, TemplateURL doesn't have a search url, doesn't support
// replacement, or doesn't have valid GURL. Ignore it.
« no previous file with comments | « chrome/browser/importer/in_process_importer_bridge.cc ('k') | chrome/browser/search_engines/template_url_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698