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

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 Ian's comments and fix bugs caused by test cases. Created 4 years, 2 months 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 ee12247b7e05e9ee6eb700c5464e914503b57d10..aeafbbc6dbd31d1e1573fda2d5bf3ff08cc57020 100644
--- a/components/search_engines/template_url_service.cc
+++ b/components/search_engines/template_url_service.cc
@@ -1642,8 +1642,8 @@ bool TemplateURLService::CanAddAutogeneratedKeywordForHost(
}
bool TemplateURLService::CanReplace(const TemplateURL* t_url) {
- return (t_url != default_search_provider_ && !t_url->show_in_default_list() &&
- t_url->safe_for_autoreplace());
+ return (t_url != default_search_provider_ && t_url->prepopulate_id() <= 0 &&
+ !t_url->created_by_policy() && t_url->safe_for_autoreplace());
}
TemplateURL* TemplateURLService::FindNonExtensionTemplateURLForKeyword(

Powered by Google App Engine
This is Rietveld 408576698