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

Unified Diff: chrome/browser/search_engines/template_url.h

Issue 343823002: Move GenerateSearchURL() and GenerateKeyword() from TemplateURLService to TemplateURL (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
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..c421da84bf044c2895ee0880bec2e757bf6429e3 100644
--- a/chrome/browser/search_engines/template_url.h
+++ b/chrome/browser/search_engines/template_url.h
@@ -649,6 +649,15 @@ class TemplateURL {
base::string16* encoded_terms,
base::string16* encoded_original_query) const;
+ // 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 00:17:49 Nit: Place this with the other static methods abov
hashimoto 2014/06/19 01:11:45 Moved to below GenerateFaviconURL() which is someh
+
+ // 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);
« no previous file with comments | « chrome/browser/search_engines/search_provider_install_data.cc ('k') | chrome/browser/search_engines/template_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698