OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // keyword/url pair, or there is one but it can be replaced. If there is an | 111 // keyword/url pair, or there is one but it can be replaced. If there is an |
112 // existing keyword that can be replaced and template_url_to_replace is | 112 // existing keyword that can be replaced and template_url_to_replace is |
113 // non-NULL, template_url_to_replace is set to the keyword to replace. | 113 // non-NULL, template_url_to_replace is set to the keyword to replace. |
114 // | 114 // |
115 // url gives the url of the search query. The url is used to avoid generating | 115 // url gives the url of the search query. The url is used to avoid generating |
116 // a TemplateURL for an existing TemplateURL that shares the same host. | 116 // a TemplateURL for an existing TemplateURL that shares the same host. |
117 bool CanReplaceKeyword(const string16& keyword, | 117 bool CanReplaceKeyword(const string16& keyword, |
118 const GURL& url, | 118 const GURL& url, |
119 TemplateURL** template_url_to_replace); | 119 TemplateURL** template_url_to_replace); |
120 | 120 |
121 // Returns (in |matches|) all keywords beginning with |prefix|, sorted | 121 // Returns (in |matches|) all TemplateURLs whose keywords begin with |prefix|, |
122 // shortest-first. If support_replacement_only is true, only keywords that | 122 // sorted shortest keyword-first. If |support_replacement_only| is true, only |
123 // support replacement are returned. | 123 // TemplateURLs that support replacement are returned. |
124 void FindMatchingKeywords(const string16& prefix, | 124 void FindMatchingKeywords(const string16& prefix, |
125 bool support_replacement_only, | 125 bool support_replacement_only, |
126 std::vector<string16>* matches) const; | 126 TemplateURLVector* matches) const; |
127 | 127 |
128 // Looks up |keyword| and returns the element it maps to. Returns NULL if | 128 // Looks up |keyword| and returns the element it maps to. Returns NULL if |
129 // the keyword was not found. | 129 // the keyword was not found. |
130 // The caller should not try to delete the returned pointer; the data store | 130 // The caller should not try to delete the returned pointer; the data store |
131 // retains ownership of it. | 131 // retains ownership of it. |
132 TemplateURL* GetTemplateURLForKeyword(const string16& keyword); | 132 TemplateURL* GetTemplateURLForKeyword(const string16& keyword); |
133 | 133 |
134 // Returns that TemplateURL with the specified GUID, or NULL if not found. | 134 // Returns that TemplateURL with the specified GUID, or NULL if not found. |
135 // The caller should not try to delete the returned pointer; the data store | 135 // The caller should not try to delete the returned pointer; the data store |
136 // retains ownership of it. | 136 // retains ownership of it. |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 | 689 |
690 // This is used to log the origin of changes to the default search provider. | 690 // This is used to log the origin of changes to the default search provider. |
691 // We set this value to increasingly specific values when we know what is the | 691 // We set this value to increasingly specific values when we know what is the |
692 // cause/origin of a default search change. | 692 // cause/origin of a default search change. |
693 DefaultSearchChangeOrigin dsp_change_origin_; | 693 DefaultSearchChangeOrigin dsp_change_origin_; |
694 | 694 |
695 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 695 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
696 }; | 696 }; |
697 | 697 |
698 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 698 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
OLD | NEW |