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

Unified Diff: chrome/browser/search_engines/template_url_service.h

Issue 15572002: Implemented 'Reset Search engines' feature. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Android compilation error 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_service.h
diff --git a/chrome/browser/search_engines/template_url_service.h b/chrome/browser/search_engines/template_url_service.h
index 13bb8d9831e0ce7dd0f13923897ab343242f1d34..964b3588a71f89df95cf381863bebca6570ceffa 100644
--- a/chrome/browser/search_engines/template_url_service.h
+++ b/chrome/browser/search_engines/template_url_service.h
@@ -216,6 +216,13 @@ class TemplateURLService : public WebDataServiceConsumer,
// NOTE: At least in unittest mode, this may return NULL.
TemplateURL* GetDefaultSearchProvider();
+ // Clears user preferences describing the default search engine.
+ void ClearDefaultProviderFromPrefs();
+
+ // Clears non-extension URLs and reloads again prepopulated engines.
+ // Resets the default engine unless it's managed.
+ bool ResetNonExtensionURLs();
+
// Returns true if the default search is managed through group policy.
bool is_default_search_managed() const { return is_default_search_managed_; }
@@ -582,6 +589,18 @@ class TemplateURLService : public WebDataServiceConsumer,
void OnSyncedDefaultSearchProviderGUIDChanged();
+ // Adds |*template_urls| to |template_urls_| and sets up default search
+ // provider according to the internal logic.
+ // |template_urls| comes from database.
+ // |default_search_provider| specifies URL inside |*template_urls|.
+ void AddTemplateURLsAndSetupDefaultEngine(
+ TemplateURLVector* template_urls,
battre 2013/05/22 14:03:37 pass as const-ref or indicate that this is an opti
vasilii 2013/05/22 18:54:08 The method consumes |template_urls| and modifies i
+ TemplateURL* default_search_provider);
+
+ // This sets the default search engine to FindNewDefaultSearchProvider(),
+ // if it's unmanaged and NULL.
+ void EnsureDefaultSearchProviderExists();
+
content::NotificationRegistrar notification_registrar_;
PrefChangeRegistrar pref_change_registrar_;

Powered by Google App Engine
This is Rietveld 408576698