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

Unified Diff: components/search_engines/template_url_service.cc

Issue 2367373003: [Android] Allow setting recently visited search engines as default search engine (Closed)
Patch Set: Update based on Peter and Dan'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: components/search_engines/template_url_service.cc
diff --git a/components/search_engines/template_url_service.cc b/components/search_engines/template_url_service.cc
index 664fa3390a3a2ec1775d070a925493347201018e..4d7a28455a200cfcd4ac1674cdd7b72b758b6b31 100644
--- a/components/search_engines/template_url_service.cc
+++ b/components/search_engines/template_url_service.cc
@@ -395,10 +395,15 @@ bool TemplateURLService::CanAddAutogeneratedKeyword(
CanAddAutogeneratedKeywordForHost(url.host());
}
+bool TemplateURLService::IsPrepopulatedOrCreatedByPolicy(
+ const TemplateURL* t_url) {
+ return (t_url->prepopulate_id() > 0 || t_url->created_by_policy()) &&
+ t_url->SupportsReplacement(search_terms_data());
+}
+
bool TemplateURLService::ShowInDefaultList(const TemplateURL* t_url) {
- return (t_url == default_search_provider_ || t_url->prepopulate_id() > 0 ||
- t_url->created_by_policy()) &&
- t_url->SupportsReplacement(search_terms_data());
+ return t_url == default_search_provider_ ||
+ IsPrepopulatedOrCreatedByPolicy(t_url);
}
void TemplateURLService::AddMatchingKeywords(

Powered by Google App Engine
This is Rietveld 408576698