Index: chrome/browser/search_engines/template_url.h |
diff --git a/chrome/browser/search_engines/template_url.h b/chrome/browser/search_engines/template_url.h |
index ec07d520d1880e7e5610cb25b9e15398b62d6690..b105b5889ba6e915a9fafdb5ef4e9acc09b59a0e 100644 |
--- a/chrome/browser/search_engines/template_url.h |
+++ b/chrome/browser/search_engines/template_url.h |
@@ -482,6 +482,11 @@ class TemplateURL { |
// Generates a favicon URL from the specified url. |
static GURL GenerateFaviconURL(const GURL& url); |
+ // Generates a suitable keyword for the specified url, which must be valid. |
+ // This is guaranteed not to return an empty string, since TemplateURLs should |
+ // never have an empty keyword. |
+ static base::string16 GenerateKeyword(const GURL& url); |
Peter Kasting
2014/06/19 17:41:59
Tiny nit: Given that the keyword member comes befo
hashimoto
2014/06/19 17:56:05
Makes sense.
Done.
|
+ |
// Returns true if |t_url| and |data| are equal in all meaningful respects. |
// Static to allow either or both params to be NULL. |
static bool MatchesData(const TemplateURL* t_url, |
@@ -649,6 +654,10 @@ class TemplateURL { |
base::string16* encoded_terms, |
base::string16* encoded_original_query) const; |
+ // Returns the search url for this template URL. |
+ // Returns an empty GURL if this template URL has no url(). |
+ GURL GenerateSearchURL(const SearchTermsData& search_terms_data) const; |
+ |
private: |
friend class TemplateURLService; |
FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ReflectsBookmarkBarPinned); |
@@ -661,8 +670,7 @@ class TemplateURL { |
// Resets the keyword if IsGoogleSearchURLWithReplaceableKeyword() or |force|. |
// The |force| parameter is useful when the existing keyword is known to be |
// a placeholder. The resulting keyword is generated using |
- // TemplateURLService::GenerateSearchURL() and |
- // TemplateURLService::GenerateKeyword(). |
+ // GenerateSearchURL() and GenerateKeyword(). |
void ResetKeywordIfNecessary(const SearchTermsData& search_terms_data, |
bool force); |