| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 class PrefService; | 10 class PrefService; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 SEARCH_ENGINE_CENTRUM, | 25 SEARCH_ENGINE_CENTRUM, |
| 26 SEARCH_ENGINE_NETSPRINT, | 26 SEARCH_ENGINE_NETSPRINT, |
| 27 SEARCH_ENGINE_VIRGILIO, | 27 SEARCH_ENGINE_VIRGILIO, |
| 28 SEARCH_ENGINE_MAILRU, | 28 SEARCH_ENGINE_MAILRU, |
| 29 SEARCH_ENGINE_MAX // Bounding max value needed for UMA histogram macro. | 29 SEARCH_ENGINE_MAX // Bounding max value needed for UMA histogram macro. |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 void RegisterUserPrefs(PrefService* prefs); | 32 void RegisterUserPrefs(PrefService* prefs); |
| 33 | 33 |
| 34 // Returns the current version of the prepopulate data, so callers can know when | 34 // Returns the current version of the prepopulate data, so callers can know when |
| 35 // they need to re-merge. | 35 // they need to re-merge. If the prepopulate data comes from the preferences |
| 36 int GetDataVersion(); | 36 // file then it returns the version specified there. |
| 37 int GetDataVersion(PrefService* prefs); |
| 37 | 38 |
| 38 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the | 39 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the |
| 39 // TemplateURLs is passed to the caller. On return, | 40 // TemplateURLs is passed to the caller. On return, |
| 40 // |default_search_provider_index| is set to the index of the default search | 41 // |default_search_provider_index| is set to the index of the default search |
| 41 // provider. | 42 // provider. |
| 42 void GetPrepopulatedEngines(PrefService* prefs, | 43 void GetPrepopulatedEngines(PrefService* prefs, |
| 43 std::vector<TemplateURL*>* t_urls, | 44 std::vector<TemplateURL*>* t_urls, |
| 44 size_t* default_search_provider_index); | 45 size_t* default_search_provider_index); |
| 45 | 46 |
| 46 // Returns the type of the search engine to be recorded in UMA. The type | 47 // Returns the type of the search engine to be recorded in UMA. The type |
| 47 // is determined by mapping the search engine's |id| to the set of search | 48 // is determined by mapping the search engine's |id| to the set of search |
| 48 // engines we are interested in. Because this is only a temporary test | 49 // engines we are interested in. Because this is only a temporary test |
| 49 // for a small set of search engines, we use this simple switch statement | 50 // for a small set of search engines, we use this simple switch statement |
| 50 // instead of embedding a UMA type as part of the struct of every search | 51 // instead of embedding a UMA type as part of the struct of every search |
| 51 // engine. | 52 // engine. |
| 52 SearchEngineType GetSearchEngineType(const TemplateURL* search_engine); | 53 SearchEngineType GetSearchEngineType(const TemplateURL* search_engine); |
| 53 | 54 |
| 54 } // namespace TemplateURLPrepopulateData | 55 } // namespace TemplateURLPrepopulateData |
| 55 | 56 |
| 56 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 57 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
| OLD | NEW |