Chromium Code Reviews| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 int GetDataVersion(PrefService* prefs); | 47 int GetDataVersion(PrefService* prefs); |
| 48 | 48 |
| 49 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the | 49 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the |
| 50 // TemplateURLs is passed to the caller. On return, | 50 // TemplateURLs is passed to the caller. On return, |
| 51 // |default_search_provider_index| is set to the index of the default search | 51 // |default_search_provider_index| is set to the index of the default search |
| 52 // provider. | 52 // provider. |
| 53 void GetPrepopulatedEngines(Profile* profile, | 53 void GetPrepopulatedEngines(Profile* profile, |
| 54 std::vector<TemplateURL*>* t_urls, | 54 std::vector<TemplateURL*>* t_urls, |
| 55 size_t* default_search_provider_index); | 55 size_t* default_search_provider_index); |
| 56 | 56 |
| 57 // Removes prepopulated engines stored in user prefs and overwrites its version. | |
|
battre
2013/05/22 14:03:37
what does "its" refer to?
vasilii
2013/05/22 18:54:08
Done.
| |
| 58 void ClearPrepopulatedEnginesInPrefs(Profile* profile); | |
| 59 | |
| 57 // Returns the default search provider specified by the prepopulate data. | 60 // Returns the default search provider specified by the prepopulate data. |
| 58 // The caller owns the returned value, which may be NULL. | 61 // The caller owns the returned value, which may be NULL. |
| 59 // If |profile| is NULL, any search provider overrides from the preferences are | 62 // If |profile| is NULL, any search provider overrides from the preferences are |
| 60 // not used. | 63 // not used. |
| 61 TemplateURL* GetPrepopulatedDefaultSearch(Profile* profile); | 64 TemplateURL* GetPrepopulatedDefaultSearch(Profile* profile); |
| 62 | 65 |
| 63 // Returns the type of the matching engine, or SEARCH_ENGINE_OTHER if no engines | 66 // Returns the type of the matching engine, or SEARCH_ENGINE_OTHER if no engines |
| 64 // match. This uses same-origin checks unless the |url| is a Google seach URL, | 67 // match. This uses same-origin checks unless the |url| is a Google seach URL, |
| 65 // in which case we'll identify any valid Google hostname as "Google". | 68 // in which case we'll identify any valid Google hostname as "Google". |
| 66 // | 69 // |
| 67 // NOTE: Must be called on the UI thread. | 70 // NOTE: Must be called on the UI thread. |
| 68 SearchEngineType GetEngineType(const std::string& url); | 71 SearchEngineType GetEngineType(const std::string& url); |
| 69 | 72 |
| 70 // Returns the logo at the specified |size| for |template_url|. If no logo is | 73 // Returns the logo at the specified |size| for |template_url|. If no logo is |
| 71 // known, this will return an empty GURL. | 74 // known, this will return an empty GURL. |
| 72 // | 75 // |
| 73 // NOTE: Must be called on the UI thread. | 76 // NOTE: Must be called on the UI thread. |
| 74 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); | 77 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); |
| 75 | 78 |
| 76 } // namespace TemplateURLPrepopulateData | 79 } // namespace TemplateURLPrepopulateData |
| 77 | 80 |
| 78 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 81 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
| OLD | NEW |