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

Unified Diff: chrome/browser/search_engines/template_url_prepopulate_data.cc

Issue 15572002: Implemented 'Reset Search engines' feature. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with trunk + Peter's comments Created 7 years, 7 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: chrome/browser/search_engines/template_url_prepopulate_data.cc
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc
index 235f621966a62123151a531121ec714b2b6dfccf..efbb266f60d75054491325c8be38a0273f8bed8f 100644
--- a/chrome/browser/search_engines/template_url_prepopulate_data.cc
+++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc
@@ -1197,6 +1197,16 @@ void GetPrepopulatedTemplateFromPrefs(Profile* profile,
}
}
+void ClearPrepopulatedEnginesInPrefs(Profile* profile) {
+ if (!profile)
+ return;
+
+ PrefService* prefs = profile->GetPrefs();
+ DCHECK(prefs);
+ prefs->ClearPref(prefs::kSearchProviderOverrides);
+ prefs->ClearPref(prefs::kSearchProviderOverridesVersion);
+}
+
// The caller owns the returned TemplateURL.
TemplateURL* MakePrepopulatedTemplateURLFromPrepopulateEngine(
Profile* profile,

Powered by Google App Engine
This is Rietveld 408576698