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

Unified Diff: components/search_engines/template_url.cc

Issue 2479113002: Make extensions DSE persistent in browser prefs (Closed)
Patch Set: Fixed default extension keywords conflicts problem Created 3 years, 11 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
« no previous file with comments | « components/search_engines/template_url.h ('k') | components/search_engines/template_url_prepopulate_data.h » ('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 016e0c5412ff634559c044e889fa7d0531901135..5e4dd451c63b806d49f9578ae05c2bc82a1f688e 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,19 @@ 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 == 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 search_terms_replacement_key1 == search_terms_replacement_key2;
+}
+
base::string16 TemplateURL::AdjustedShortNameForLocaleDirection() const {
base::string16 bidi_safe_short_name = data_.short_name();
base::i18n::AdjustStringForLocaleDirection(&bidi_safe_short_name);
« no previous file with comments | « components/search_engines/template_url.h ('k') | components/search_engines/template_url_prepopulate_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698