Chromium Code Reviews| 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 whether |template_url| should be shown in the list of engines | 136 // Retruns whether |template_url| should be shown in the list of engines |
|
Peter Kasting
2016/11/29 03:32:19
Nit: Typo
ltian
2016/11/30 06:36:17
Done.
| |
| 137 // most likely to be selected as a default engine. This is meant to highlight | 137 // most likely to be selected as a default engine. This includes all |
| 138 // the current default, as well as the other most likely choices of default | 138 // prepopulated engines and engines created by policy. |
| 139 // engine, separately from a full list of all TemplateURLs (which might be | 139 bool ShowInPrepopulatedList(const TemplateURL* template_url); |
| 140 // very long). | 140 |
| 141 // Returns whether |template_url| is the current default or return true for | |
| 142 // ShowInPrepopulatedList(). This is meant to highlight the current default, | |
| 143 // as well as the other most likely choices of default engine, separately | |
| 144 // from a full list of all TemplateURLs (which might be very long). | |
|
Peter Kasting
2016/11/29 03:32:19
These comments are still confusingly overlapping.
ltian
2016/11/30 06:36:17
Done.
| |
| 141 bool ShowInDefaultList(const TemplateURL* template_url); | 145 bool ShowInDefaultList(const TemplateURL* template_url); |
| 142 | 146 |
| 143 // Adds to |matches| all TemplateURLs whose keywords begin with |prefix|, | 147 // Adds to |matches| all TemplateURLs whose keywords begin with |prefix|, |
| 144 // sorted shortest-keyword-first. If |supports_replacement_only| is true, only | 148 // sorted shortest-keyword-first. If |supports_replacement_only| is true, only |
| 145 // TemplateURLs that support replacement are returned. | 149 // TemplateURLs that support replacement are returned. |
| 146 void AddMatchingKeywords(const base::string16& prefix, | 150 void AddMatchingKeywords(const base::string16& prefix, |
| 147 bool supports_replacement_only, | 151 bool supports_replacement_only, |
| 148 TURLsAndMeaningfulLengths* matches); | 152 TURLsAndMeaningfulLengths* matches); |
| 149 | 153 |
| 150 // Adds to |matches| all TemplateURLs for search engines with the domain | 154 // Adds to |matches| all TemplateURLs for search engines with the domain |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 821 // Helper class to manage the default search engine. | 825 // Helper class to manage the default search engine. |
| 822 DefaultSearchManager default_search_manager_; | 826 DefaultSearchManager default_search_manager_; |
| 823 | 827 |
| 824 std::unique_ptr<GoogleURLTracker::Subscription> | 828 std::unique_ptr<GoogleURLTracker::Subscription> |
| 825 google_url_updated_subscription_; | 829 google_url_updated_subscription_; |
| 826 | 830 |
| 827 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 831 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
| 828 }; | 832 }; |
| 829 | 833 |
| 830 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 834 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| OLD | NEW |