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

Side by Side Diff: chrome/browser/autocomplete/base_search_provider.cc

Issue 343823002: Move GenerateSearchURL() and GenerateKeyword() from TemplateURLService to TemplateURL (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/autocomplete/base_search_provider.h" 5 #include "chrome/browser/autocomplete/base_search_provider.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/i18n/icu_string_conversions.h" 8 #include "base/i18n/icu_string_conversions.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 } 459 }
460 460
461 void BaseSearchProvider::SetDeletionURL(const std::string& deletion_url, 461 void BaseSearchProvider::SetDeletionURL(const std::string& deletion_url,
462 AutocompleteMatch* match) { 462 AutocompleteMatch* match) {
463 if (deletion_url.empty()) 463 if (deletion_url.empty())
464 return; 464 return;
465 TemplateURLService* template_service = 465 TemplateURLService* template_service =
466 TemplateURLServiceFactory::GetForProfile(profile_); 466 TemplateURLServiceFactory::GetForProfile(profile_);
467 if (!template_service) 467 if (!template_service)
468 return; 468 return;
469 GURL url = TemplateURLService::GenerateSearchURL( 469 GURL url = template_service->GetDefaultSearchProvider()->GenerateSearchURL(
470 template_service->GetDefaultSearchProvider(),
471 template_service->search_terms_data()); 470 template_service->search_terms_data());
472 url = url.GetOrigin().Resolve(deletion_url); 471 url = url.GetOrigin().Resolve(deletion_url);
473 if (url.is_valid()) { 472 if (url.is_valid()) {
474 match->RecordAdditionalInfo(BaseSearchProvider::kDeletionUrlKey, 473 match->RecordAdditionalInfo(BaseSearchProvider::kDeletionUrlKey,
475 url.spec()); 474 url.spec());
476 match->deletable = true; 475 match->deletable = true;
477 } 476 }
478 } 477 }
479 478
480 // BaseSearchProvider --------------------------------------------------------- 479 // BaseSearchProvider ---------------------------------------------------------
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 } 976 }
978 977
979 void BaseSearchProvider::OnDeletionComplete( 978 void BaseSearchProvider::OnDeletionComplete(
980 bool success, SuggestionDeletionHandler* handler) { 979 bool success, SuggestionDeletionHandler* handler) {
981 RecordDeletionResult(success); 980 RecordDeletionResult(success);
982 SuggestionDeletionHandlers::iterator it = std::find( 981 SuggestionDeletionHandlers::iterator it = std::find(
983 deletion_handlers_.begin(), deletion_handlers_.end(), handler); 982 deletion_handlers_.begin(), deletion_handlers_.end(), handler);
984 DCHECK(it != deletion_handlers_.end()); 983 DCHECK(it != deletion_handlers_.end());
985 deletion_handlers_.erase(it); 984 deletion_handlers_.erase(it);
986 } 985 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/importer/in_process_importer_bridge.cc » ('j') | chrome/browser/search_engines/template_url.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698