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

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

Issue 13727003: Remove unused BuildQueryTerms from TemplateURLService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
Index: chrome/browser/search_engines/template_url_service.cc
diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc
index ce0e2eca8b182ddfcdde9508accb6955f375b5d8..912f9b1078b754b9746399600ef56171f7066e4d 100644
--- a/chrome/browser/search_engines/template_url_service.cc
+++ b/chrome/browser/search_engines/template_url_service.cc
@@ -1910,38 +1910,6 @@ void TemplateURLService::AddTabToSearchVisit(const TemplateURL& t_url) {
history::SOURCE_BROWSED, false);
}
-// static
-bool TemplateURLService::BuildQueryTerms(const GURL& url,
- QueryTerms* query_terms) {
- url_parse::Component query = url.parsed_for_possibly_invalid_spec().query;
- url_parse::Component key, value;
- size_t valid_term_count = 0;
- while (url_parse::ExtractQueryKeyValue(url.spec().c_str(), &query, &key,
- &value)) {
- if (key.is_nonempty() && value.is_nonempty()) {
- std::string key_string = url.spec().substr(key.begin, key.len);
- std::string value_string = url.spec().substr(value.begin, value.len);
- QueryTerms::iterator query_terms_iterator =
- query_terms->find(key_string);
- if (query_terms_iterator != query_terms->end()) {
- if (!query_terms_iterator->second.empty() &&
- query_terms_iterator->second != value_string) {
- // The term occurs in multiple places with different values. Treat
- // this as if the term doesn't occur by setting the value to an empty
- // string.
- (*query_terms)[key_string] = std::string();
- DCHECK(valid_term_count > 0);
- valid_term_count--;
- }
- } else {
- valid_term_count++;
- (*query_terms)[key_string] = value_string;
- }
- }
- }
- return (valid_term_count > 0);
-}
-
void TemplateURLService::GoogleBaseURLChanged(const GURL& old_base_url) {
bool something_changed = false;
for (TemplateURLVector::iterator i(template_urls_.begin());
« no previous file with comments | « chrome/browser/search_engines/template_url_service.h ('k') | chrome/browser/search_engines/template_url_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698