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_UTIL_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_UTIL_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_UTIL_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_UTIL_H_ |
7 | 7 |
8 // This file contains utility functions for search engine functionality. | 8 // This file contains utility functions for search engine functionality. |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // except for any user-set names and keywords, which can be preserved. | 55 // except for any user-set names and keywords, which can be preserved. |
56 // (3) New prepopulated engines not in the user's engine list, which should be | 56 // (3) New prepopulated engines not in the user's engine list, which should be |
57 // added. | 57 // added. |
58 | 58 |
59 // The pair of current search engine and its new value. | 59 // The pair of current search engine and its new value. |
60 typedef std::pair<TemplateURL*, TemplateURLData> EditedSearchEngine; | 60 typedef std::pair<TemplateURL*, TemplateURLData> EditedSearchEngine; |
61 typedef std::vector<EditedSearchEngine> EditedEngines; | 61 typedef std::vector<EditedSearchEngine> EditedEngines; |
62 | 62 |
63 struct ActionsFromPrepopulateData { | 63 struct ActionsFromPrepopulateData { |
64 ActionsFromPrepopulateData(); | 64 ActionsFromPrepopulateData(); |
| 65 ActionsFromPrepopulateData(const ActionsFromPrepopulateData& other); |
65 ~ActionsFromPrepopulateData(); | 66 ~ActionsFromPrepopulateData(); |
66 | 67 |
67 TemplateURLService::TemplateURLVector removed_engines; | 68 TemplateURLService::TemplateURLVector removed_engines; |
68 EditedEngines edited_engines; | 69 EditedEngines edited_engines; |
69 std::vector<TemplateURLData> added_engines; | 70 std::vector<TemplateURLData> added_engines; |
70 }; | 71 }; |
71 | 72 |
72 // Given the user's current URLs and the current set of prepopulated URLs, | 73 // Given the user's current URLs and the current set of prepopulated URLs, |
73 // produces the set of actions (see above) required to make the user's URLs | 74 // produces the set of actions (see above) required to make the user's URLs |
74 // reflect the prepopulate data. |default_search_provider| is used to avoid | 75 // reflect the prepopulate data. |default_search_provider| is used to avoid |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // so it's accessible by unittests. | 131 // so it's accessible by unittests. |
131 void RemoveDuplicatePrepopulateIDs( | 132 void RemoveDuplicatePrepopulateIDs( |
132 KeywordWebDataService* service, | 133 KeywordWebDataService* service, |
133 const ScopedVector<TemplateURLData>& prepopulated_urls, | 134 const ScopedVector<TemplateURLData>& prepopulated_urls, |
134 TemplateURL* default_search_provider, | 135 TemplateURL* default_search_provider, |
135 TemplateURLService::TemplateURLVector* template_urls, | 136 TemplateURLService::TemplateURLVector* template_urls, |
136 const SearchTermsData& search_terms_data, | 137 const SearchTermsData& search_terms_data, |
137 std::set<std::string>* removed_keyword_guids); | 138 std::set<std::string>* removed_keyword_guids); |
138 | 139 |
139 #endif // COMPONENTS_SEARCH_ENGINES_UTIL_H_ | 140 #endif // COMPONENTS_SEARCH_ENGINES_UTIL_H_ |
OLD | NEW |