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

Unified Diff: components/search_engines/template_url.cc

Issue 2479113002: Make extensions DSE persistent in browser prefs (Closed)
Patch Set: Added DSE tests 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
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..c2a0d67c133d70bc041252ba6bb0af7bef3ae0f4 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -163,22 +163,6 @@ bool IsTemplateParameterString(const std::string& param) {
(*(param.rbegin()) == kEndParameter);
}
-// Special case for search_terms_replacement_key comparison, because of
-// its special initialization in TemplateUrl constructor.
-bool SearchTermsReplacementKeysMatch(
- const std::string& search_terms_replacement_key1,
- const std::string& search_terms_replacement_key2) {
- if (search_terms_replacement_key1 == search_terms_replacement_key2)
- return true;
- if (search_terms_replacement_key1 == google_util::kInstantExtendedAPIParam &&
- search_terms_replacement_key2 == kGoogleInstantExtendedEnabledKey)
- return true;
- if (search_terms_replacement_key2 == google_util::kInstantExtendedAPIParam &&
- search_terms_replacement_key1 == kGoogleInstantExtendedEnabledKey)
- return true;
- return false;
-}
-
} // namespace
@@ -1276,6 +1260,23 @@ bool TemplateURL::MatchesData(const TemplateURL* t_url,
data->search_terms_replacement_key);
}
+// static
+// Special case for search_terms_replacement_key comparison, because of
+// its special initialization in TemplateUrl constructor.
vasilii 2016/11/30 14:00:03 Move the comment to the header.
Alexander Yashkin 2016/12/05 18:16:48 Done
+bool TemplateURL::SearchTermsReplacementKeysMatch(
+ const std::string& search_terms_replacement_key1,
+ const std::string& search_terms_replacement_key2) {
+ if (search_terms_replacement_key1 == search_terms_replacement_key2)
+ return true;
+ if (search_terms_replacement_key1 == google_util::kInstantExtendedAPIParam &&
+ search_terms_replacement_key2 == kGoogleInstantExtendedEnabledKey)
+ return true;
+ if (search_terms_replacement_key2 == google_util::kInstantExtendedAPIParam &&
+ search_terms_replacement_key1 == kGoogleInstantExtendedEnabledKey)
+ return true;
+ return false;
+}
+
base::string16 TemplateURL::AdjustedShortNameForLocaleDirection() const {
base::string16 bidi_safe_short_name = data_.short_name();
base::i18n::AdjustStringForLocaleDirection(&bidi_safe_short_name);

Powered by Google App Engine
This is Rietveld 408576698