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

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

Issue 10409002: Make prepopulated-TemplateURL-de-duper heuristic smarter. Instead of blindly preserving the first U… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: use scopedvector Created 8 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/util.h
diff --git a/chrome/browser/search_engines/util.h b/chrome/browser/search_engines/util.h
index c480f53d7ca30588d0c52ceab07b222db8e3ef8c..0e96ae971ff6fb3aea98c6ba7e88e6859c0e8331 100644
--- a/chrome/browser/search_engines/util.h
+++ b/chrome/browser/search_engines/util.h
@@ -13,6 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
+#include "chrome/browser/search_engines/template_url_service.h"
class Profile;
class TemplateURL;
@@ -40,7 +41,7 @@ void GetSearchProvidersUsingKeywordResult(
const WDTypedResult& result,
WebDataService* service,
Profile* profile,
- std::vector<TemplateURL*>* template_urls,
+ TemplateURLService::TemplateURLVector* template_urls,
TemplateURL** default_search_provider,
int* new_resource_keyword_version,
std::set<std::string>* removed_keyword_guids);
@@ -54,4 +55,16 @@ bool DidDefaultSearchProviderChange(
Profile* profile,
scoped_ptr<TemplateURL>* backup_default_search_provider);
+// Removes (and deletes) TemplateURLs from |template_urls| and |service| if they
+// have duplicate prepopulate ids. If |removed_keyword_guids| is not NULL, the
+// Sync GUID of each item removed from the DB will be added to it. This is a
+// helper used by GetSearchProvidersUsingKeywordResult(), but is declared here
+// so it's accessible by unittests.
+void RemoveDuplicatePrepopulateIDs(
+ WebDataService* service,
+ const ScopedVector<TemplateURL>& prepopulated_urls,
+ TemplateURL* default_search_provider,
+ TemplateURLService::TemplateURLVector* template_urls,
+ std::set<std::string>* removed_keyword_guids);
+
#endif // CHROME_BROWSER_SEARCH_ENGINES_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698