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

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: rebase 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..c0482a7a3515d51570fe70921fcbd79ad038f46e 100644
--- a/chrome/browser/search_engines/template_url.h
+++ b/chrome/browser/search_engines/template_url.h
@@ -479,6 +479,11 @@ class TemplateURL {
explicit TemplateURL(const TemplateURLData& data);
~TemplateURL();
+ // 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);
+
// Generates a favicon URL from the specified url.
static GURL GenerateFaviconURL(const GURL& 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);
« 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