diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-18 22:39:35 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-18 22:39:35 +0000 |
commit | 026e017c2f75e87bca73ad813a57a3c026724e03 (patch) | |
tree | 4508f85b4abeb4d6d7a245adfe72103b4d00dfd3 | |
parent | 963e87c67a78a953c0a5fb1ce06949d0afb6109e (diff) | |
download | chromium_src-026e017c2f75e87bca73ad813a57a3c026724e03.zip chromium_src-026e017c2f75e87bca73ad813a57a3c026724e03.tar.gz chromium_src-026e017c2f75e87bca73ad813a57a3c026724e03.tar.bz2 |
Removing usage of profile_->GetHistory() from the codebase in order to remove that function.
BUG=97804
TEST=existing unittests
Review URL: https://chromiumcodereview.appspot.com/10563011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142837 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc index 3311906..77b3efe 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor.cc @@ -19,6 +19,7 @@ #include "chrome/browser/autocomplete/autocomplete_match.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/history_notifications.h" +#include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/in_memory_database.h" #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h" #include "chrome/browser/predictors/predictor_database.h" @@ -432,7 +433,7 @@ void AutocompleteActionPredictor::CreateCaches( // If the history service is ready, delete any old or invalid entries. HistoryService* history_service = - profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); + HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); if (!TryDeleteOldEntries(history_service)) { // Wait for the notification that the history service is ready and the URL // DB is loaded. diff --git a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc index 7c76bc3..11f82c4 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc @@ -14,6 +14,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/autocomplete/autocomplete_match.h" #include "chrome/browser/history/history.h" +#include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/in_memory_database.h" #include "chrome/browser/history/url_database.h" #include "chrome/browser/prerender/prerender_field_trial.h" @@ -119,7 +120,8 @@ class AutocompleteActionPredictorTest : public testing::Test { history::URLID AddRowToHistory(const TestUrlInfo& test_row) { HistoryService* history = - profile_.GetHistoryService(Profile::EXPLICIT_ACCESS); + HistoryServiceFactory::GetForProfile(&profile_, + Profile::EXPLICIT_ACCESS); CHECK(history); history::URLDatabase* url_db = history->InMemoryDatabase(); CHECK(url_db); @@ -182,7 +184,8 @@ class AutocompleteActionPredictorTest : public testing::Test { void DeleteOldIdsFromCaches( std::vector<AutocompleteActionPredictorTable::Row::Id>* id_list) { HistoryService* history_service = - profile_.GetHistoryService(Profile::EXPLICIT_ACCESS); + HistoryServiceFactory::GetForProfile(&profile_, + Profile::EXPLICIT_ACCESS); ASSERT_TRUE(history_service); history::URLDatabase* url_db = history_service->InMemoryDatabase(); diff --git a/chrome/browser/prerender/prerender_local_predictor.cc b/chrome/browser/prerender/prerender_local_predictor.cc index 5fee136..f8925b7 100644 --- a/chrome/browser/prerender/prerender_local_predictor.cc +++ b/chrome/browser/prerender/prerender_local_predictor.cc @@ -14,6 +14,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/history_database.h" +#include "chrome/browser/history/history_service_factory.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/page_transition_types.h" @@ -308,7 +309,7 @@ HistoryService* PrerenderLocalPredictor::GetHistoryIfExists() const { Profile* profile = prerender_manager_->profile(); if (!profile) return NULL; - return profile->GetHistoryServiceWithoutCreating(); + return HistoryServiceFactory::GetForProfileIfExists(profile); } void PrerenderLocalPredictor::Init() { |