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

Unified Diff: chrome/browser/autocomplete/shortcuts_backend.cc

Issue 354773002: Reduces dependency from AutocompleteMatch to Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/shortcuts_backend.cc
diff --git a/chrome/browser/autocomplete/shortcuts_backend.cc b/chrome/browser/autocomplete/shortcuts_backend.cc
index 71254aae9df8c57c8e1741f70a30090a0e12e524..fd0916cca33ffd0517fc9c9199a248433032654f 100644
--- a/chrome/browser/autocomplete/shortcuts_backend.cc
+++ b/chrome/browser/autocomplete/shortcuts_backend.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/history/shortcuts_database.h"
#include "chrome/browser/omnibox/omnibox_log.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
#include "chrome/common/autocomplete_match_type.h"
#include "chrome/common/chrome_constants.h"
@@ -143,12 +144,14 @@ history::ShortcutsDatabase::Shortcut::MatchCore
ShortcutsBackend::MatchToMatchCore(const AutocompleteMatch& match,
Profile* profile) {
const AutocompleteMatch::Type match_type = GetTypeForShortcut(match.type);
+ TemplateURLService* service =
+ TemplateURLServiceFactory::GetForProfile(profile);
const AutocompleteMatch& normalized_match =
AutocompleteMatch::IsSpecializedSearchType(match.type) ?
BaseSearchProvider::CreateSearchSuggestion(
match.search_terms_args->search_terms, match_type,
(match.transition == content::PAGE_TRANSITION_KEYWORD),
- match.GetTemplateURL(profile, false),
+ match.GetTemplateURL(service, false),
UIThreadSearchTermsData(profile)) :
match;
return history::ShortcutsDatabase::Shortcut::MatchCore(
« no previous file with comments | « chrome/browser/autocomplete/search_provider_unittest.cc ('k') | chrome/browser/autocomplete/shortcuts_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698