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

Unified Diff: components/search_engines/template_url.cc

Issue 2524733008: Fix for google:instantExtendedEnabledKey replacement (Closed)
Patch Set: Added unittest Created 4 years, 1 month 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 | « no previous file | components/search_engines/template_url_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index eb1998a24b0cdf47f116e2c476a62fbf4ab35963..d87461ee62cb6ee22e8df78cc307668165750ede 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -68,6 +68,8 @@ const char kDefaultCount[] = "10";
const char kOutputEncodingType[] = "UTF-8";
constexpr char kGoogleInstantExtendedEnabledKey[] =
+ "google:instantExtendedEnabledKey";
+constexpr char kGoogleInstantExtendedEnabledKeyFull[] =
"{google:instantExtendedEnabledKey}";
// Attempts to encode |terms| and |original_query| in |encoding| and escape
@@ -171,10 +173,10 @@ bool SearchTermsReplacementKeysMatch(
if (search_terms_replacement_key1 == search_terms_replacement_key2)
return true;
if (search_terms_replacement_key1 == google_util::kInstantExtendedAPIParam &&
- search_terms_replacement_key2 == kGoogleInstantExtendedEnabledKey)
+ search_terms_replacement_key2 == kGoogleInstantExtendedEnabledKeyFull)
return true;
if (search_terms_replacement_key2 == google_util::kInstantExtendedAPIParam &&
- search_terms_replacement_key1 == kGoogleInstantExtendedEnabledKey)
+ search_terms_replacement_key1 == kGoogleInstantExtendedEnabledKeyFull)
return true;
return false;
}
@@ -1211,7 +1213,8 @@ TemplateURL::TemplateURL(const TemplateURLData& data, Type type)
ResizeURLRefVector();
SetPrepopulateId(data_.prepopulate_id);
- if (data_.search_terms_replacement_key == kGoogleInstantExtendedEnabledKey)
+ if (data_.search_terms_replacement_key ==
+ kGoogleInstantExtendedEnabledKeyFull)
data_.search_terms_replacement_key = google_util::kInstantExtendedAPIParam;
}
« no previous file with comments | « no previous file | components/search_engines/template_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698