Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: components/search_engines/template_url_service.h

Issue 2811793007: Make several methods of TemplateUrlService const (Closed)
Patch Set: Remove unnecessary local variable and add a couple TODOs Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/search_engines/template_url_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4187327f06a21b14b590b8a7e0b5a6d5b9c30147 100644
--- a/components/search_engines/template_url_service.h
+++ b/components/search_engines/template_url_service.h
@@ -135,14 +135,14 @@ class TemplateURLService : public WebDataServiceConsumer,
// 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);
@@ -543,13 +544,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 +662,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|)
« no previous file with comments | « no previous file | components/search_engines/template_url_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698