Ensure that TemplateURLs removed by prepopulate search engine merging is also removed from Sync.
We do this by keeping a list of pre-sync deleted GUIDs, which is populated whenever a TemplateURL entry is removed from the DB during startup merging. We then use this list to ignore the appropriate entries from Sync, and to inform Sync that they should be deleted.
BUG=128210
TEST=unit_test TemplateURLServiceSyncTest.PreSyncDeletes
Review URL: https://chromiumcodereview.appspot.com/10384188
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137490 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/search_engines/util.h b/chrome/browser/search_engines/util.h
index 31b8fb2a..c480f53 100644
--- a/chrome/browser/search_engines/util.h
+++ b/chrome/browser/search_engines/util.h
@@ -7,6 +7,8 @@
#pragma once
// This file contains utility functions for search engine functionality.
+#include <set>
+#include <string>
#include <vector>
#include "base/memory/scoped_ptr.h"
@@ -31,14 +33,17 @@
// |*new_resource_keyword_version| is set to 0 if no new value. Otherwise,
// it is the new value.
// Only pass in a non-NULL value for service if the WebDataService should be
-// updated.
+// updated. If |removed_keyword_guids| is not NULL, any TemplateURLs removed
+// from the keyword table in the WebDataService will have their Sync GUIDs
+// added to it.
void GetSearchProvidersUsingKeywordResult(
const WDTypedResult& result,
WebDataService* service,
Profile* profile,
std::vector<TemplateURL*>* template_urls,
TemplateURL** default_search_provider,
- int* new_resource_keyword_version);
+ int* new_resource_keyword_version,
+ std::set<std::string>* removed_keyword_guids);
// Returns true if the default search provider setting has been changed or
// corrupted. Returns the backup setting in |backup_default_search_provider|.