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

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: rebase 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
« no previous file with comments | « no previous file | chrome/browser/importer/in_process_importer_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 } 461 }
462 462
463 void BaseSearchProvider::SetDeletionURL(const std::string& deletion_url, 463 void BaseSearchProvider::SetDeletionURL(const std::string& deletion_url,
464 AutocompleteMatch* match) { 464 AutocompleteMatch* match) {
465 if (deletion_url.empty()) 465 if (deletion_url.empty())
466 return; 466 return;
467 TemplateURLService* template_service = 467 TemplateURLService* template_service =
468 TemplateURLServiceFactory::GetForProfile(profile_); 468 TemplateURLServiceFactory::GetForProfile(profile_);
469 if (!template_service) 469 if (!template_service)
470 return; 470 return;
471 GURL url = TemplateURLService::GenerateSearchURL( 471 GURL url = template_service->GetDefaultSearchProvider()->GenerateSearchURL(
472 template_service->GetDefaultSearchProvider(),
473 template_service->search_terms_data()); 472 template_service->search_terms_data());
474 url = url.GetOrigin().Resolve(deletion_url); 473 url = url.GetOrigin().Resolve(deletion_url);
475 if (url.is_valid()) { 474 if (url.is_valid()) {
476 match->RecordAdditionalInfo(BaseSearchProvider::kDeletionUrlKey, 475 match->RecordAdditionalInfo(BaseSearchProvider::kDeletionUrlKey,
477 url.spec()); 476 url.spec());
478 match->deletable = true; 477 match->deletable = true;
479 } 478 }
480 } 479 }
481 480
482 // BaseSearchProvider --------------------------------------------------------- 481 // BaseSearchProvider ---------------------------------------------------------
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 } 1006 }
1008 1007
1009 void BaseSearchProvider::OnDeletionComplete( 1008 void BaseSearchProvider::OnDeletionComplete(
1010 bool success, SuggestionDeletionHandler* handler) { 1009 bool success, SuggestionDeletionHandler* handler) {
1011 RecordDeletionResult(success); 1010 RecordDeletionResult(success);
1012 SuggestionDeletionHandlers::iterator it = std::find( 1011 SuggestionDeletionHandlers::iterator it = std::find(
1013 deletion_handlers_.begin(), deletion_handlers_.end(), handler); 1012 deletion_handlers_.begin(), deletion_handlers_.end(), handler);
1014 DCHECK(it != deletion_handlers_.end()); 1013 DCHECK(it != deletion_handlers_.end());
1015 deletion_handlers_.erase(it); 1014 deletion_handlers_.erase(it);
1016 } 1015 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/importer/in_process_importer_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698