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

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

Issue 11552020: Add search_terms_replacement_key field to TemplateURL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with protector removal Created 8 years 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_prepopulate_data.cc
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc
index 9e9e27937c84d79df68a3f54c66ed18a2d9e1f55..12e04910814b683315f98383355e58394f554b92 100644
--- a/chrome/browser/search_engines/template_url_prepopulate_data.cc
+++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc
@@ -1110,16 +1110,18 @@ int GetDataVersion(PrefService* prefs) {
kCurrentDataVersion;
}
-TemplateURL* MakePrepopulatedTemplateURL(Profile* profile,
- const string16& name,
- const string16& keyword,
- const base::StringPiece& search_url,
- const base::StringPiece& suggest_url,
- const base::StringPiece& instant_url,
- const ListValue& alternate_urls,
- const base::StringPiece& favicon_url,
- const base::StringPiece& encoding,
- int id) {
+TemplateURL* MakePrepopulatedTemplateURL(
+ Profile* profile,
+ const string16& name,
+ const string16& keyword,
+ const base::StringPiece& search_url,
+ const base::StringPiece& suggest_url,
+ const base::StringPiece& instant_url,
+ const ListValue& alternate_urls,
+ const base::StringPiece& search_terms_replacement_key,
+ const base::StringPiece& favicon_url,
+ const base::StringPiece& encoding,
+ int id) {
TemplateURLData data;
@@ -1134,6 +1136,7 @@ TemplateURL* MakePrepopulatedTemplateURL(Profile* profile,
DCHECK(!alternate_url.empty());
data.alternate_urls.push_back(alternate_url);
}
+ data.search_terms_replacement_key = search_terms_replacement_key.as_string();
Peter Kasting 2012/12/18 01:54:43 Nit: Set this member in the same order that the Te
beaudoin 2012/12/20 04:23:29 Fixed alternate_urls at the same time. Done.
data.favicon_url = GURL(favicon_url.as_string());
data.show_in_default_list = true;
data.safe_for_autoreplace = true;
@@ -1175,14 +1178,17 @@ void GetPrepopulatedTemplateFromPrefs(Profile* profile,
// These fields are optional.
std::string suggest_url;
std::string instant_url;
+ std::string search_terms_replacement_key;
ListValue empty_list;
const ListValue* alternate_urls = &empty_list;
engine->GetString("suggest_url", &suggest_url);
engine->GetString("instant_url", &instant_url);
engine->GetList("alternate_urls", &alternate_urls);
+ engine->GetString("search_terms_replacement_key",
+ &search_terms_replacement_key);
t_urls->push_back(MakePrepopulatedTemplateURL(profile, name, keyword,
- search_url, suggest_url, instant_url, *alternate_urls, favicon_url,
- encoding, id));
+ search_url, suggest_url, instant_url, *alternate_urls,
+ search_terms_replacement_key, favicon_url, encoding, id));
}
}
}
@@ -1200,7 +1206,7 @@ TemplateURL* MakePrepopulatedTemplateURLFromPrepopulateEngine(
return MakePrepopulatedTemplateURL(profile, WideToUTF16(engine.name),
WideToUTF16(engine.keyword), engine.search_url, engine.suggest_url,
- engine.instant_url, alternate_urls,
+ engine.instant_url, alternate_urls, engine.search_terms_replacement_key,
engine.favicon_url, engine.encoding, engine.id);
}

Powered by Google App Engine
This is Rietveld 408576698