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

Unified Diff: chrome/browser/search_engines/util.cc

Issue 17022004: Replace --google-base-suggest-url and --instant-url with --google-base-url. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/search_engines/util.h ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/util.cc
===================================================================
--- chrome/browser/search_engines/util.cc (revision 208572)
+++ chrome/browser/search_engines/util.cc (working copy)
@@ -39,6 +39,21 @@
return default_provider->short_name();
}
+GURL GetDefaultSearchURLForSearchTerms(Profile* profile,
+ const string16& terms) {
+ DCHECK(profile);
+ const TemplateURL* default_provider =
+ TemplateURLServiceFactory::GetForProfile(profile)->
+ GetDefaultSearchProvider();
+ if (!default_provider)
+ return GURL();
+ const TemplateURLRef& search_url = default_provider->url_ref();
+ DCHECK(search_url.SupportsReplacement());
+ TemplateURLRef::SearchTermsArgs search_terms_args(terms);
+ search_terms_args.append_extra_query_params = true;
+ return GURL(search_url.ReplaceSearchTerms(search_terms_args));
+}
+
void RemoveDuplicatePrepopulateIDs(
WebDataService* service,
const ScopedVector<TemplateURL>& prepopulated_urls,
« no previous file with comments | « chrome/browser/search_engines/util.h ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698