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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 // name part of the keyword starts with |prefix|, sorted | 144 // name part of the keyword starts with |prefix|, sorted |
| 145 // shortest-domain-name-first. If |supports_replacement_only| is true, only | 145 // shortest-domain-name-first. If |supports_replacement_only| is true, only |
| 146 // TemplateURLs that support replacement are returned. Does not bother | 146 // TemplateURLs that support replacement are returned. Does not bother |
| 147 // searching/returning keywords that would've been found with an identical | 147 // searching/returning keywords that would've been found with an identical |
| 148 // call to FindMatchingKeywords(); i.e., doesn't search keywords for which | 148 // call to FindMatchingKeywords(); i.e., doesn't search keywords for which |
| 149 // the domain name is the keyword. | 149 // the domain name is the keyword. |
| 150 void AddMatchingDomainKeywords(const base::string16& prefix, | 150 void AddMatchingDomainKeywords(const base::string16& prefix, |
| 151 bool supports_replacement_only, | 151 bool supports_replacement_only, |
| 152 TURLsAndMeaningfulLengths* matches); | 152 TURLsAndMeaningfulLengths* matches); |
| 153 | 153 |
| 154 // Returns true if the TempalteURL is prepopulated or created by policy. | |
|
Peter Kasting
2016/11/02 00:34:03
Nit: TemplateURL
ltian
2016/11/22 21:51:41
Done.
| |
| 155 bool IsInDefaultList(const TemplateURL* url); | |
|
Peter Kasting
2016/11/02 00:34:03
It seems like this is really a const member method
ltian
2016/11/22 21:51:41
Not exist any more.
| |
| 156 | |
| 154 // Looks up |keyword| and returns the element it maps to. Returns NULL if | 157 // Looks up |keyword| and returns the element it maps to. Returns NULL if |
| 155 // the keyword was not found. | 158 // the keyword was not found. |
| 156 // The caller should not try to delete the returned pointer; the data store | 159 // The caller should not try to delete the returned pointer; the data store |
| 157 // retains ownership of it. | 160 // retains ownership of it. |
| 158 TemplateURL* GetTemplateURLForKeyword(const base::string16& keyword); | 161 TemplateURL* GetTemplateURLForKeyword(const base::string16& keyword); |
| 159 | 162 |
| 160 // Returns that TemplateURL with the specified GUID, or NULL if not found. | 163 // Returns that TemplateURL with the specified GUID, or NULL if not found. |
| 161 // The caller should not try to delete the returned pointer; the data store | 164 // The caller should not try to delete the returned pointer; the data store |
| 162 // retains ownership of it. | 165 // retains ownership of it. |
| 163 TemplateURL* GetTemplateURLForGUID(const std::string& sync_guid); | 166 TemplateURL* GetTemplateURLForGUID(const std::string& sync_guid); |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 814 // Helper class to manage the default search engine. | 817 // Helper class to manage the default search engine. |
| 815 DefaultSearchManager default_search_manager_; | 818 DefaultSearchManager default_search_manager_; |
| 816 | 819 |
| 817 std::unique_ptr<GoogleURLTracker::Subscription> | 820 std::unique_ptr<GoogleURLTracker::Subscription> |
| 818 google_url_updated_subscription_; | 821 google_url_updated_subscription_; |
| 819 | 822 |
| 820 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 823 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
| 821 }; | 824 }; |
| 822 | 825 |
| 823 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 826 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| OLD | NEW |