Extract the processing of the web data service results processing in a standalone function.

BUG=38475
TEST=unit_test --gtest_filter=Temp*

Review URL: http://codereview.chromium.org/3110038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57563 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/search_engines/util.h b/chrome/browser/search_engines/util.h
index 1391e6d..e517ba6 100644
--- a/chrome/browser/search_engines/util.h
+++ b/chrome/browser/search_engines/util.h
@@ -7,13 +7,37 @@
 #pragma once
 
 // This file contains utility functions for search engine functionality.
+#include <vector>
 
 #include "base/string16.h"
 
+class PrefService;
 class Profile;
+class TemplateURL;
+class WDTypedResult;
+class WebDataService;
 
 // Returns the short name of the default search engine, or the empty string if
 // none is set. |profile| may be NULL.
 string16 GetDefaultSearchEngineName(Profile* profile);
 
+// Processes the results of WebDataService::GetKeywords, combining it with
+// prepopulated search providers to result in:
+//  * a set of template_urls (search providers). The caller owns the
+//    TemplateURL* returned in template_urls.
+//  * the default search provider (and if *default_search_provider is not NULL,
+//    it is contained in template_urls).
+//  * whether there is a new resource keyword version (and the value).
+//    |*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.
+void GetSearchProvidersUsingKeywordResult(
+    const WDTypedResult& result,
+    WebDataService* service,
+    PrefService* prefs,
+    std::vector<TemplateURL*>* template_urls,
+    const TemplateURL** default_search_provider,
+    int* new_resource_keyword_version);
+
 #endif  // CHROME_BROWSER_SEARCH_ENGINES_UTIL_H_