• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_
7 #pragma once
8 
9 #include <vector>
10 
11 class GURL;
12 class PrefService;
13 class TemplateURL;
14 
15 namespace TemplateURLPrepopulateData {
16 
17 void RegisterUserPrefs(PrefService* prefs);
18 
19 // Returns the current version of the prepopulate data, so callers can know when
20 // they need to re-merge. If the prepopulate data comes from the preferences
21 // file then it returns the version specified there.
22 int GetDataVersion(PrefService* prefs);
23 
24 // Loads the set of TemplateURLs from the prepopulate data.  Ownership of the
25 // TemplateURLs is passed to the caller.  On return,
26 // |default_search_provider_index| is set to the index of the default search
27 // provider.
28 void GetPrepopulatedEngines(PrefService* prefs,
29                             std::vector<TemplateURL*>* t_urls,
30                             size_t* default_search_provider_index);
31 
32 // Returns the default search provider specified by the prepopulate data.
33 // The caller owns the returned value, which may be NULL.
34 TemplateURL* GetPrepopulatedDefaultSearch(PrefService* prefs);
35 
36 // Returns a TemplateURL from the prepopulated data which has the same origin
37 // as the given url.  The caller is responsible for deleting the returned
38 // TemplateURL.
39 TemplateURL* GetEngineForOrigin(PrefService* prefs, const GURL& url_to_find);
40 
41 // Returns search engine logo for URLs known to have a search engine logo.
42 int GetSearchEngineLogo(const GURL& url_to_find);
43 
44 }  // namespace TemplateURLPrepopulateData
45 
46 #endif  // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_
47