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 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... |
22 struct TemplateURLData; | 22 struct TemplateURLData; |
23 | 23 |
24 namespace user_prefs { | 24 namespace user_prefs { |
25 class PrefRegistrySyncable; | 25 class PrefRegistrySyncable; |
26 } | 26 } |
27 | 27 |
28 namespace TemplateURLPrepopulateData { | 28 namespace TemplateURLPrepopulateData { |
29 | 29 |
30 extern const int kMaxPrepopulatedEngineID; | 30 extern const int kMaxPrepopulatedEngineID; |
31 | 31 |
32 #if defined(OS_ANDROID) | |
33 // This must be called early only once. |country_code| is the country code at | |
34 // install following the ISO-3166 specification. | |
35 void InitCountryCode(const std::string& country_code); | |
36 #endif | |
37 | |
38 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 32 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
39 | 33 |
40 // 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 |
41 // they need to re-merge. If the prepopulate data comes from the preferences | 35 // they need to re-merge. If the prepopulate data comes from the preferences |
42 // file then it returns the version specified there. | 36 // file then it returns the version specified there. |
43 int GetDataVersion(PrefService* prefs); | 37 int GetDataVersion(PrefService* prefs); |
44 | 38 |
45 // Loads the set of TemplateURLs from the prepopulate data. On return, | 39 // Loads the set of TemplateURLs from the prepopulate data. On return, |
46 // |default_search_provider_index| is set to the index of the default search | 40 // |default_search_provider_index| is set to the index of the default search |
47 // provider. | 41 // provider. |
(...skipping 19 matching lines...) Expand all Loading... |
67 SearchEngineType GetEngineType(const TemplateURL& template_url, | 61 SearchEngineType GetEngineType(const TemplateURL& template_url, |
68 const SearchTermsData& search_terms_data); | 62 const SearchTermsData& search_terms_data); |
69 | 63 |
70 // Like the above, but takes a GURL which is expected to represent a search URL. | 64 // Like the above, but takes a GURL which is expected to represent a search URL. |
71 // This may be called on any thread. | 65 // This may be called on any thread. |
72 SearchEngineType GetEngineType(const GURL& url); | 66 SearchEngineType GetEngineType(const GURL& url); |
73 | 67 |
74 } // namespace TemplateURLPrepopulateData | 68 } // namespace TemplateURLPrepopulateData |
75 | 69 |
76 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 70 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
OLD | NEW |