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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // country code. If the given locale is the same as the existing locale, returns | 48 // country code. If the given locale is the same as the existing locale, returns |
49 // an empty vector. | 49 // an empty vector. |
50 std::vector<std::unique_ptr<TemplateURLData>> GetLocalPrepopulatedEngines( | 50 std::vector<std::unique_ptr<TemplateURLData>> GetLocalPrepopulatedEngines( |
51 const std::string& locale, | 51 const std::string& locale, |
52 PrefService* prefs); | 52 PrefService* prefs); |
53 #endif | 53 #endif |
54 | 54 |
55 // Returns all prepopulated engines for all locales. Used only by tests. | 55 // Returns all prepopulated engines for all locales. Used only by tests. |
56 std::vector<const PrepopulatedEngine*> GetAllPrepopulatedEngines(); | 56 std::vector<const PrepopulatedEngine*> GetAllPrepopulatedEngines(); |
57 | 57 |
58 // Returns a TemplateURLData for the specified prepopulated engine. | |
59 std::unique_ptr<TemplateURLData> MakeTemplateURLDataFromPrepopulatedEngine( | |
60 const PrepopulatedEngine& engine); | |
61 | |
62 // Removes prepopulated engines and their version stored in user prefs. | 58 // Removes prepopulated engines and their version stored in user prefs. |
63 void ClearPrepopulatedEnginesInPrefs(PrefService* prefs); | 59 void ClearPrepopulatedEnginesInPrefs(PrefService* prefs); |
64 | 60 |
65 // Returns the default search provider specified by the prepopulate data, which | 61 // Returns the default search provider specified by the prepopulate data, which |
66 // may be NULL. | 62 // may be NULL. |
67 // If |prefs| is NULL, any search provider overrides from the preferences are | 63 // If |prefs| is NULL, any search provider overrides from the preferences are |
68 // not used. | 64 // not used. |
69 std::unique_ptr<TemplateURLData> GetPrepopulatedDefaultSearch( | 65 std::unique_ptr<TemplateURLData> GetPrepopulatedDefaultSearch( |
70 PrefService* prefs); | 66 PrefService* prefs); |
71 | 67 |
72 // Like the above, but takes a GURL which is expected to represent a search URL. | 68 // Like the above, but takes a GURL which is expected to represent a search URL. |
73 // This may be called on any thread. | 69 // This may be called on any thread. |
74 SearchEngineType GetEngineType(const GURL& url); | 70 SearchEngineType GetEngineType(const GURL& url); |
75 | 71 |
76 // Returns the identifier for the user current country. Used to update the list | 72 // Returns the identifier for the user current country. Used to update the list |
77 // of search engines when user switches device region settings. For use on iOS | 73 // of search engines when user switches device region settings. For use on iOS |
78 // only. | 74 // only. |
79 // TODO(ios): Once user can customize search engines ( http://crbug.com/153047 ) | 75 // TODO(ios): Once user can customize search engines ( http://crbug.com/153047 ) |
80 // this declaration should be removed and the definition in the .cc file be | 76 // this declaration should be removed and the definition in the .cc file be |
81 // moved back to the anonymous namespace. | 77 // moved back to the anonymous namespace. |
82 int GetCurrentCountryID(); | 78 int GetCurrentCountryID(); |
83 | 79 |
84 } // namespace TemplateURLPrepopulateData | 80 } // namespace TemplateURLPrepopulateData |
85 | 81 |
86 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 82 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
OLD | NEW |