OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 #endif | 37 #endif |
38 | 38 |
39 void RegisterUserPrefs(PrefServiceSyncable* prefs); | 39 void RegisterUserPrefs(PrefServiceSyncable* prefs); |
40 | 40 |
41 // Returns the current version of the prepopulate data, so callers can know when | 41 // Returns the current version of the prepopulate data, so callers can know when |
42 // they need to re-merge. If the prepopulate data comes from the preferences | 42 // they need to re-merge. If the prepopulate data comes from the preferences |
43 // file then it returns the version specified there. | 43 // file then it returns the version specified there. |
44 int GetDataVersion(PrefService* prefs); | 44 int GetDataVersion(PrefService* prefs); |
45 | 45 |
| 46 // The caller owns the returned TemplateURL. Returns NULL if |prepopulate_id| |
| 47 // does not correspond to a built-in prepopulated engines. |
| 48 TemplateURL* MakeTemplateURLFromPrepopulateId(Profile* profile, |
| 49 int prepopulate_id); |
| 50 |
46 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the | 51 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the |
47 // TemplateURLs is passed to the caller. On return, | 52 // TemplateURLs is passed to the caller. On return, |
48 // |default_search_provider_index| is set to the index of the default search | 53 // |default_search_provider_index| is set to the index of the default search |
49 // provider. | 54 // provider. |
50 void GetPrepopulatedEngines(Profile* profile, | 55 void GetPrepopulatedEngines(Profile* profile, |
51 std::vector<TemplateURL*>* t_urls, | 56 std::vector<TemplateURL*>* t_urls, |
52 size_t* default_search_provider_index); | 57 size_t* default_search_provider_index); |
53 | 58 |
54 // Returns the default search provider specified by the prepopulate data. | 59 // Returns the default search provider specified by the prepopulate data. |
55 // The caller owns the returned value, which may be NULL. | 60 // The caller owns the returned value, which may be NULL. |
(...skipping 10 matching lines...) Expand all Loading... |
66 | 71 |
67 // Returns the logo at the specified |size| for |template_url|. If no logo is | 72 // Returns the logo at the specified |size| for |template_url|. If no logo is |
68 // known, this will return an empty GURL. | 73 // known, this will return an empty GURL. |
69 // | 74 // |
70 // NOTE: Must be called on the UI thread. | 75 // NOTE: Must be called on the UI thread. |
71 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); | 76 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); |
72 | 77 |
73 } // namespace TemplateURLPrepopulateData | 78 } // namespace TemplateURLPrepopulateData |
74 | 79 |
75 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 80 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
OLD | NEW |