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

Unified Diff: components/search_engines/template_url.cc

Issue 2479113002: Make extensions DSE persistent in browser prefs (Closed)
Patch Set: Fixed after review, round 7 Created 4 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: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index 016e0c5412ff634559c044e889fa7d0531901135..8d2b1cf07683d2739078b2b7b6905d5c3b77b011 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -165,22 +165,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 == kGoogleInstantExtendedEnabledKeyFull)
- return true;
- if (search_terms_replacement_key2 == google_util::kInstantExtendedAPIParam &&
- search_terms_replacement_key1 == kGoogleInstantExtendedEnabledKeyFull)
- return true;
- return false;
-}
-
} // namespace
@@ -1281,6 +1265,21 @@ bool TemplateURL::MatchesData(const TemplateURL* t_url,
data->search_terms_replacement_key);
}
+// static
+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)
Peter Kasting 2017/01/06 01:44:58 Nit: If you move this to the end of the conditions
Alexander Yashkin 2017/01/07 12:56:00 Done, although I think, performance-wise, its the
+ return true;
+ if (search_terms_replacement_key1 == google_util::kInstantExtendedAPIParam &&
+ search_terms_replacement_key2 == kGoogleInstantExtendedEnabledKeyFull)
+ return true;
+ if (search_terms_replacement_key2 == google_util::kInstantExtendedAPIParam &&
+ search_terms_replacement_key1 == kGoogleInstantExtendedEnabledKeyFull)
+ 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