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

Unified Diff: components/search_engines/template_url_prepopulate_data.cc

Issue 2479113002: Make extensions DSE persistent in browser prefs (Closed)
Patch Set: Fixed default extension keywords conflicts problem Created 3 years, 11 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_prepopulate_data.cc
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
index 40604f5f8a4515e5b678c344ab07eb617010ce3a..a7c7e1e351e3039e782ccbb65d5aff38bff9b190 100644
--- a/components/search_engines/template_url_prepopulate_data.cc
+++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -1042,6 +1042,18 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines(
return GetPrepopulationSetFromCountryID(GetCountryIDFromPrefs(prefs));
}
+std::unique_ptr<TemplateURLData> GetPrepopulatedEngine(PrefService* prefs,
+ int prepopulated_id) {
+ size_t default_index;
+ auto engines =
+ TemplateURLPrepopulateData::GetPrepopulatedEngines(prefs, &default_index);
+ for (auto& engine : engines) {
+ if (engine->prepopulate_id == prepopulated_id)
+ return std::move(engine);
+ }
+ return nullptr;
+}
+
#if defined(OS_ANDROID)
std::vector<std::unique_ptr<TemplateURLData>> GetLocalPrepopulatedEngines(
« no previous file with comments | « components/search_engines/template_url_prepopulate_data.h ('k') | components/search_engines/template_url_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698