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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 // keyword/url pair, or there is one but it can be replaced. If there is an | 126 // keyword/url pair, or there is one but it can be replaced. If there is an |
127 // existing keyword that can be replaced and template_url_to_replace is | 127 // existing keyword that can be replaced and template_url_to_replace is |
128 // non-NULL, template_url_to_replace is set to the keyword to replace. | 128 // non-NULL, template_url_to_replace is set to the keyword to replace. |
129 // | 129 // |
130 // |url| is the URL of the search query. This is used to prevent auto-adding | 130 // |url| is the URL of the search query. This is used to prevent auto-adding |
131 // a keyword for hosts already associated with a manually-edited keyword. | 131 // a keyword for hosts already associated with a manually-edited keyword. |
132 bool CanAddAutogeneratedKeyword(const base::string16& keyword, | 132 bool CanAddAutogeneratedKeyword(const base::string16& keyword, |
133 const GURL& url, | 133 const GURL& url, |
134 TemplateURL** template_url_to_replace); | 134 TemplateURL** template_url_to_replace); |
135 | 135 |
136 // Returns true if the template_url is in the default list. An TemplateURL is | |
137 // in the default list if it is the default search provider or its | |
138 // prepopulated | |
139 // id is greater than 0 or it is created by policy. | |
Ian Wen
2016/11/09 19:58:52
Again, comments not well formatted.
Peter Kasting
2016/11/10 06:41:07
Nit: How about this comment, which is more about w
ltian
2016/11/11 03:52:13
Done.
ltian
2016/11/11 03:52:13
Good point. I will add this in together with a des
| |
140 bool ShowInDefaultList(const TemplateURL* template_url); | |
141 | |
136 // Adds to |matches| all TemplateURLs whose keywords begin with |prefix|, | 142 // Adds to |matches| all TemplateURLs whose keywords begin with |prefix|, |
137 // sorted shortest-keyword-first. If |supports_replacement_only| is true, only | 143 // sorted shortest-keyword-first. If |supports_replacement_only| is true, only |
138 // TemplateURLs that support replacement are returned. | 144 // TemplateURLs that support replacement are returned. |
139 void AddMatchingKeywords(const base::string16& prefix, | 145 void AddMatchingKeywords(const base::string16& prefix, |
140 bool supports_replacement_only, | 146 bool supports_replacement_only, |
141 TURLsAndMeaningfulLengths* matches); | 147 TURLsAndMeaningfulLengths* matches); |
142 | 148 |
143 // Adds to |matches| all TemplateURLs for search engines with the domain | 149 // Adds to |matches| all TemplateURLs for search engines with the domain |
144 // name part of the keyword starts with |prefix|, sorted | 150 // name part of the keyword starts with |prefix|, sorted |
145 // shortest-domain-name-first. If |supports_replacement_only| is true, only | 151 // shortest-domain-name-first. If |supports_replacement_only| is true, only |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
814 // Helper class to manage the default search engine. | 820 // Helper class to manage the default search engine. |
815 DefaultSearchManager default_search_manager_; | 821 DefaultSearchManager default_search_manager_; |
816 | 822 |
817 std::unique_ptr<GoogleURLTracker::Subscription> | 823 std::unique_ptr<GoogleURLTracker::Subscription> |
818 google_url_updated_subscription_; | 824 google_url_updated_subscription_; |
819 | 825 |
820 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 826 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
821 }; | 827 }; |
822 | 828 |
823 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 829 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
OLD | NEW |