Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/search_engines/util.h

Issue 3110038: Extract the processing of the web data service results processing in a standalone function. (Closed)
Patch Set: Addressed feedback. Created 10 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_UTIL_H_ 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_UTIL_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_UTIL_H_ 6 #define CHROME_BROWSER_SEARCH_ENGINES_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 // This file contains utility functions for search engine functionality. 9 // This file contains utility functions for search engine functionality.
10 #include <vector>
10 11
11 #include "base/string16.h" 12 #include "base/string16.h"
12 13
14 class PrefService;
13 class Profile; 15 class Profile;
16 class TemplateURL;
17 class WDTypedResult;
18 class WebDataService;
14 19
15 // Returns the short name of the default search engine, or the empty string if 20 // Returns the short name of the default search engine, or the empty string if
16 // none is set. |profile| may be NULL. 21 // none is set. |profile| may be NULL.
17 string16 GetDefaultSearchEngineName(Profile* profile); 22 string16 GetDefaultSearchEngineName(Profile* profile);
18 23
24 // Processes the results of WebDataService::GetKeywords, combining it with
25 // prepopulated search providers to result in:
26 // * a set of template_urls (search providers). The caller owns the
27 // TemplateURL* returned in template_urls.
28 // * the default search provider (and if *default_search_provider is not NULL,
29 // it is contained in template_urls).
30 // * whether there is a new resource keyword version (and the value).
31 // |*new_resource_keyword_version| is set to 0 if no new value. Otherwise,
32 // it is the new value.
33 // Only pass in a non-NULL value for service if the WebDataService should be
34 // updated.
35 void GetSearchProvidersUsingKeywordResult(
36 const WDTypedResult& result,
37 WebDataService* service,
38 PrefService* prefs,
39 std::vector<TemplateURL*>* template_urls,
40 const TemplateURL** default_search_provider,
41 int* new_resource_keyword_version);
42
19 #endif // CHROME_BROWSER_SEARCH_ENGINES_UTIL_H_ 43 #endif // CHROME_BROWSER_SEARCH_ENGINES_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_model_unittest.cc ('k') | chrome/browser/search_engines/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698