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

Unified Diff: chrome/browser/search_engines/template_url_service.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
Index: chrome/browser/search_engines/template_url_service.cc
===================================================================
--- chrome/browser/search_engines/template_url_service.cc (revision 208572)
+++ chrome/browser/search_engines/template_url_service.cc (working copy)
@@ -410,7 +410,7 @@
void TemplateURLService::FindMatchingKeywords(
const string16& prefix,
bool support_replacement_only,
- std::vector<string16>* matches) const {
+ TemplateURLVector* matches) const {
// Sanity check args.
if (prefix.empty())
return;
@@ -434,7 +434,7 @@
for (KeywordToTemplateMap::const_iterator i(match_range.first);
i != match_range.second; ++i) {
if (!support_replacement_only || i->second->url_ref().SupportsReplacement())
- matches->push_back(i->first);
+ matches->push_back(i->second);
}
}
@@ -1391,7 +1391,12 @@
data.short_name = UTF8ToUTF16(initializers[i].content);
data.SetKeyword(UTF8ToUTF16(initializers[i].keyword));
data.SetURL(osd_url);
- AddNoNotify(new TemplateURL(profile_, data), true);
+ TemplateURL* template_url = new TemplateURL(profile_, data);
+ AddNoNotify(template_url, true);
+
+ // Set the first provided identifier to be the default.
+ if (!i)
+ SetDefaultSearchProviderNoNotify(template_url);
}
}
« no previous file with comments | « chrome/browser/search_engines/template_url_service.h ('k') | chrome/browser/search_engines/template_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698