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_SERVICE_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // need a raw pointer to the TemplateURL so they can access it later.) | 182 // need a raw pointer to the TemplateURL so they can access it later.) |
183 TemplateURL* Add(std::unique_ptr<TemplateURL> template_url); | 183 TemplateURL* Add(std::unique_ptr<TemplateURL> template_url); |
184 | 184 |
185 // Like Add(), but overwrites the |template_url|'s values with the provided | 185 // Like Add(), but overwrites the |template_url|'s values with the provided |
186 // ones. | 186 // ones. |
187 TemplateURL* AddWithOverrides(std::unique_ptr<TemplateURL> template_url, | 187 TemplateURL* AddWithOverrides(std::unique_ptr<TemplateURL> template_url, |
188 const base::string16& short_name, | 188 const base::string16& short_name, |
189 const base::string16& keyword, | 189 const base::string16& keyword, |
190 const std::string& url); | 190 const std::string& url); |
191 | 191 |
192 // Adds a search engine with the specified info for extensions. | |
193 TemplateURL* AddExtensionControlledTURL( | |
194 std::unique_ptr<TemplateURL> template_url, | |
195 std::unique_ptr<TemplateURL::AssociatedExtensionInfo> info); | |
196 | |
197 // Removes the keyword from the model. This deletes the supplied TemplateURL. | 192 // Removes the keyword from the model. This deletes the supplied TemplateURL. |
198 // This fails if the supplied template_url is the default search provider. | 193 // This fails if the supplied template_url is the default search provider. |
199 void Remove(TemplateURL* template_url); | 194 void Remove(TemplateURL* template_url); |
200 | 195 |
201 // Removes any TemplateURL of the specified |type| associated with | 196 // Removes any TemplateURL of the specified |type| associated with |
202 // |extension_id|. Unlike with Remove(), this can be called when the | 197 // |extension_id|. Unlike with Remove(), this can be called when the |
203 // TemplateURL in question is the current default search provider. | 198 // TemplateURL in question is the current default search provider. |
204 void RemoveExtensionControlledTURL(const std::string& extension_id, | 199 void RemoveExtensionControlledTURL(const std::string& extension_id, |
205 TemplateURL::Type type); | 200 TemplateURL::Type type); |
206 | 201 |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 // Helper class to manage the default search engine. | 843 // Helper class to manage the default search engine. |
849 DefaultSearchManager default_search_manager_; | 844 DefaultSearchManager default_search_manager_; |
850 | 845 |
851 std::unique_ptr<GoogleURLTracker::Subscription> | 846 std::unique_ptr<GoogleURLTracker::Subscription> |
852 google_url_updated_subscription_; | 847 google_url_updated_subscription_; |
853 | 848 |
854 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 849 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
855 }; | 850 }; |
856 | 851 |
857 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 852 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
OLD | NEW |