Chromium Code Reviews| Index: components/search_engines/template_url_service.h |
| diff --git a/components/search_engines/template_url_service.h b/components/search_engines/template_url_service.h |
| index b6bb73ba756d105b27c0ee507d6200176a40e3f3..68e246f6df11e4789cfa4fc39b6e7463d45c6f51 100644 |
| --- a/components/search_engines/template_url_service.h |
| +++ b/components/search_engines/template_url_service.h |
| @@ -131,18 +131,18 @@ class TemplateURLService : public WebDataServiceConsumer, |
| // a keyword for hosts already associated with a manually-edited keyword. |
| bool CanAddAutogeneratedKeyword(const base::string16& keyword, |
| const GURL& url, |
| - TemplateURL** template_url_to_replace); |
| + TemplateURL** template_url_to_replace) const; |
| // Returns whether the engine is a "pre-existing" engine, either from the |
| // prepopulate list or created by policy. |
| - bool IsPrepopulatedOrCreatedByPolicy(const TemplateURL* template_url); |
| + bool IsPrepopulatedOrCreatedByPolicy(const TemplateURL* template_url) const; |
| // Returns whether |template_url| should be shown in the list of engines |
| // most likely to be selected as a default engine. This is meant to highlight |
| // the current default, as well as the other most likely choices of default |
| // engine, separately from a full list of all TemplateURLs (which might be |
| // very long). |
| - bool ShowInDefaultList(const TemplateURL* template_url); |
| + bool ShowInDefaultList(const TemplateURL* template_url) const; |
| // Adds to |matches| all TemplateURLs whose keywords begin with |prefix|, |
| // sorted shortest-keyword-first. If |supports_replacement_only| is true, only |
| @@ -248,7 +248,7 @@ class TemplateURLService : public WebDataServiceConsumer, |
| // Return true if the given |url| can be made the default. This returns false |
| // regardless of |url| if the default search provider is managed by policy or |
| // controlled by an extension. |
| - bool CanMakeDefault(const TemplateURL* url); |
| + bool CanMakeDefault(const TemplateURL* url) const; |
| // Set the default search provider. |url| may be null. |
| // This will assert if the default search is managed; the UI should not be |
| @@ -274,7 +274,7 @@ class TemplateURLService : public WebDataServiceConsumer, |
| } |
| // Returns true if the default search provider is controlled by an extension. |
| - bool IsExtensionControlledDefaultSearch(); |
| + bool IsExtensionControlledDefaultSearch() const; |
| // Returns the default search specified in the prepopulated data, if it |
| // exists. If not, returns first URL in |template_urls_|, or NULL if that's |
| @@ -330,8 +330,9 @@ class TemplateURLService : public WebDataServiceConsumer, |
| // Returns the locale-direction-adjusted short name for the given keyword. |
| // Also sets the out param to indicate whether the keyword belongs to an |
| // Omnibox extension. |
| - base::string16 GetKeywordShortName(const base::string16& keyword, |
| - bool* is_omnibox_api_extension_keyword); |
| + base::string16 GetKeywordShortName( |
| + const base::string16& keyword, |
| + bool* is_omnibox_api_extension_keyword) const; |
| // Called by the history service when a URL is visited. |
| void OnHistoryURLVisited(const URLVisitedDetails& details); |
| @@ -493,7 +494,8 @@ class TemplateURLService : public WebDataServiceConsumer, |
| // override extension-controlled engines, which override normal engines; if |
| // there is still a conflict after this, the most recently-added extension |
| // wins. |
| - TemplateURL* BestEngineForKeyword(TemplateURL* engine1, TemplateURL* engine2); |
| + TemplateURL* BestEngineForKeyword(TemplateURL* engine1, |
| + TemplateURL* engine2); |
|
Peter Kasting
2017/04/13 06:15:35
Nit: Can probably revert this
|
| // Removes |template_url| from various internal maps |
| // (|keyword_to_turl_and_length_|, |keyword_domain_to_turl_and_length_|, |
| @@ -543,13 +545,13 @@ class TemplateURLService : public WebDataServiceConsumer, |
| // Returns false if there is a TemplateURL that has a search url with the |
| // specified host and that TemplateURL has been manually modified. |
| - bool CanAddAutogeneratedKeywordForHost(const std::string& host); |
| + bool CanAddAutogeneratedKeywordForHost(const std::string& host) const; |
| // Returns true if the TemplateURL is replaceable. This doesn't look at the |
| // uniqueness of the keyword or host and is intended to be called after those |
| // checks have been done. This returns true if the TemplateURL doesn't appear |
| // in the default list and is marked as safe_for_autoreplace. |
| - bool CanReplace(const TemplateURL* t_url); |
| + bool CanReplace(const TemplateURL* t_url) const; |
| // Like GetTemplateURLForKeyword(), but ignores extension-provided keywords. |
| TemplateURL* FindNonExtensionTemplateURLForKeyword( |
| @@ -661,7 +663,7 @@ class TemplateURLService : public WebDataServiceConsumer, |
| // search provider |
| bool IsLocalTemplateURLBetter(const TemplateURL* local_turl, |
| const TemplateURL* sync_turl, |
| - bool prefer_local_default = true); |
| + bool prefer_local_default = true) const; |
| // Given two synced TemplateURLs with a conflicting keyword, one of which |
| // needs to be added to or updated in the local model (|unapplied_sync_turl|) |