Chromium Code Reviews| Index: chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc |
| diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc |
| index 2bd10f638947b81dc45402731494aee1aa567350..c4becf88bbe1759e16a6b1b9f3b66335888e523a 100644 |
| --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc |
| +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc |
| @@ -9,6 +9,7 @@ |
| #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
| #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" |
| #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h" |
| +#include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| #include "chrome/browser/history/history_service_factory.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/sync/profile_sync_service.h" |
| @@ -51,6 +52,15 @@ ChromeAutocompleteProviderClient::SchemeClassifier() { |
| return scheme_classifier_; |
| } |
| +history::HistoryService* ChromeAutocompleteProviderClient::HistoryService() { |
| + return HistoryServiceFactory::GetForProfile( |
| + profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| +} |
| + |
| +bookmarks::BookmarkModel* ChromeAutocompleteProviderClient::BookmarkModel() { |
| + return BookmarkModelFactory::GetForProfile(profile_); |
| +} |
| + |
| void ChromeAutocompleteProviderClient::Classify( |
| const base::string16& text, |
| bool prefer_keyword, |
| @@ -66,18 +76,14 @@ void ChromeAutocompleteProviderClient::Classify( |
| } |
| history::URLDatabase* ChromeAutocompleteProviderClient::InMemoryDatabase() { |
| - history::HistoryService* history_service = |
| - HistoryServiceFactory::GetForProfile(profile_, |
| - ServiceAccessType::EXPLICIT_ACCESS); |
| + history::HistoryService* history_service = HistoryService(); |
| return history_service ? history_service->InMemoryDatabase() : NULL; |
|
Peter Kasting
2015/06/12 16:20:23
It's not immediately obvious why in this function
blundell
2015/06/15 08:51:33
Yes, I thought this was strange as well. It dates
|
| } |
| void ChromeAutocompleteProviderClient::DeleteMatchingURLsForKeywordFromHistory( |
| history::KeywordID keyword_id, |
| const base::string16& term) { |
| - HistoryServiceFactory::GetForProfile(profile_, |
| - ServiceAccessType::EXPLICIT_ACCESS) |
| - ->DeleteMatchingURLsForKeyword(keyword_id, term); |
| + HistoryService()->DeleteMatchingURLsForKeyword(keyword_id, term); |
| } |
| bool ChromeAutocompleteProviderClient::TabSyncEnabledAndUnencrypted() { |