OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <string> | 10 #include <string> |
(...skipping 17 matching lines...) Expand all Loading... |
28 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the | 28 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the |
29 // TemplateURLs is passed to the caller. On return, | 29 // TemplateURLs is passed to the caller. On return, |
30 // |default_search_provider_index| is set to the index of the default search | 30 // |default_search_provider_index| is set to the index of the default search |
31 // provider. | 31 // provider. |
32 void GetPrepopulatedEngines(PrefService* prefs, | 32 void GetPrepopulatedEngines(PrefService* prefs, |
33 std::vector<TemplateURL*>* t_urls, | 33 std::vector<TemplateURL*>* t_urls, |
34 size_t* default_search_provider_index); | 34 size_t* default_search_provider_index); |
35 | 35 |
36 // Returns the default search provider specified by the prepopulate data. | 36 // Returns the default search provider specified by the prepopulate data. |
37 // The caller owns the returned value, which may be NULL. | 37 // The caller owns the returned value, which may be NULL. |
| 38 // If |prefs| is NULL, search provider overrides from preferences are not used. |
38 TemplateURL* GetPrepopulatedDefaultSearch(PrefService* prefs); | 39 TemplateURL* GetPrepopulatedDefaultSearch(PrefService* prefs); |
39 | 40 |
40 // Returns a TemplateURL from the prepopulated data which has the same origin | 41 // Returns a TemplateURL from the prepopulated data which has the same origin |
41 // as the given url. The caller is responsible for deleting the returned | 42 // as the given url. The caller is responsible for deleting the returned |
42 // TemplateURL. | 43 // TemplateURL. |
43 TemplateURL* GetEngineForOrigin(PrefService* prefs, const GURL& url_to_find); | 44 TemplateURL* GetEngineForOrigin(PrefService* prefs, const GURL& url_to_find); |
44 | 45 |
45 // Returns search engine logo for URLs known to have a search engine logo. | 46 // Returns search engine logo for URLs known to have a search engine logo. |
46 int GetSearchEngineLogo(const GURL& url_to_find); | 47 int GetSearchEngineLogo(const GURL& url_to_find); |
47 | 48 |
48 // Returns the prepopulated search provider whose search URL matches | 49 // Returns the prepopulated search provider whose search URL matches |
49 // |search_url| or NULL if none is found. The caller is responsible for | 50 // |search_url| or NULL if none is found. The caller is responsible for |
50 // deleting the returned TemplateURL. | 51 // deleting the returned TemplateURL. |
51 TemplateURL* FindPrepopulatedEngine(const std::string& search_url); | 52 TemplateURL* FindPrepopulatedEngine(const std::string& search_url); |
52 | 53 |
53 } // namespace TemplateURLPrepopulateData | 54 } // namespace TemplateURLPrepopulateData |
54 | 55 |
55 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 56 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
OLD | NEW |