OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 24 matching lines...) Expand all Loading... | |
35 // file then it returns the version specified there. | 35 // file then it returns the version specified there. |
36 int GetDataVersion(PrefService* prefs); | 36 int GetDataVersion(PrefService* prefs); |
37 | 37 |
38 // Loads the set of TemplateURLs from the prepopulate data. On return, | 38 // Loads the set of TemplateURLs from the prepopulate data. On return, |
39 // |default_search_provider_index| is set to the index of the default search | 39 // |default_search_provider_index| is set to the index of the default search |
40 // provider. | 40 // provider. |
41 std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines( | 41 std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines( |
42 PrefService* prefs, | 42 PrefService* prefs, |
43 size_t* default_search_provider_index); | 43 size_t* default_search_provider_index); |
44 | 44 |
45 // Loads extra prepopulated engines for the given locale. If the engines are | |
46 // already loaded, need_to-load will be set false. | |
Peter Kasting
2016/09/19 21:06:23
Nit: How about this (I rewrote both functions' com
Ian Wen
2016/09/20 04:48:03
Done.
| |
47 std::vector<std::unique_ptr<TemplateURLData>> GetLocalPrepopulatedEngines( | |
Peter Kasting
2016/09/19 21:06:23
Should this function be #if'd for Android-only? I
Ian Wen
2016/09/20 04:48:03
Done.
| |
48 const std::string& locale, | |
49 PrefService* prefs, | |
50 bool* need_to_load); | |
51 | |
45 // Returns all prepopulated engines for all locales. Used only by tests. | 52 // Returns all prepopulated engines for all locales. Used only by tests. |
46 std::vector<const PrepopulatedEngine*> GetAllPrepopulatedEngines(); | 53 std::vector<const PrepopulatedEngine*> GetAllPrepopulatedEngines(); |
47 | 54 |
48 // Returns a TemplateURLData for the specified prepopulated engine. | 55 // Returns a TemplateURLData for the specified prepopulated engine. |
49 std::unique_ptr<TemplateURLData> MakeTemplateURLDataFromPrepopulatedEngine( | 56 std::unique_ptr<TemplateURLData> MakeTemplateURLDataFromPrepopulatedEngine( |
50 const PrepopulatedEngine& engine); | 57 const PrepopulatedEngine& engine); |
51 | 58 |
52 // Removes prepopulated engines and their version stored in user prefs. | 59 // Removes prepopulated engines and their version stored in user prefs. |
53 void ClearPrepopulatedEnginesInPrefs(PrefService* prefs); | 60 void ClearPrepopulatedEnginesInPrefs(PrefService* prefs); |
54 | 61 |
(...skipping 12 matching lines...) Expand all Loading... | |
67 // of search engines when user switches device region settings. For use on iOS | 74 // of search engines when user switches device region settings. For use on iOS |
68 // only. | 75 // only. |
69 // TODO(ios): Once user can customize search engines ( http://crbug.com/153047 ) | 76 // TODO(ios): Once user can customize search engines ( http://crbug.com/153047 ) |
70 // this declaration should be removed and the definition in the .cc file be | 77 // this declaration should be removed and the definition in the .cc file be |
71 // moved back to the anonymous namespace. | 78 // moved back to the anonymous namespace. |
72 int GetCurrentCountryID(); | 79 int GetCurrentCountryID(); |
73 | 80 |
74 } // namespace TemplateURLPrepopulateData | 81 } // namespace TemplateURLPrepopulateData |
75 | 82 |
76 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 83 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
OLD | NEW |