summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 20:10:53 +0000
committerrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 20:10:53 +0000
commit9718a7228ac76041e24388b5e85792e7bc4feaff (patch)
treea11657c2268f00a476e0e0b11e5af8e5e6dfc324 /chrome/browser
parent7e5f82f341bf870793aab920a498ce2a5c12dec4 (diff)
downloadchromium_src-9718a7228ac76041e24388b5e85792e7bc4feaff.zip
chromium_src-9718a7228ac76041e24388b5e85792e7bc4feaff.tar.gz
chromium_src-9718a7228ac76041e24388b5e85792e7bc4feaff.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/10532173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/importer/profile_writer.cc3
-rw-r--r--chrome/browser/profiles/profile_manager_unittest.cc8
2 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index eb3b659..18a5201 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -13,6 +13,7 @@
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/password_manager/password_store.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -102,7 +103,7 @@ void ProfileWriter::AddIE7PasswordInfo(const IE7PasswordInfo& info) {
void ProfileWriter::AddHistoryPage(const history::URLRows& page,
history::VisitSource visit_source) {
- profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->
+ HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS)->
AddPagesWithDetails(page, visit_source);
}
diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc
index 8294c6d..cb4b604 100644
--- a/chrome/browser/profiles/profile_manager_unittest.cc
+++ b/chrome/browser/profiles/profile_manager_unittest.cc
@@ -15,6 +15,8 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_event_router_forwarder.h"
+#include "chrome/browser/history/history.h"
+#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/io_thread.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/profiles/profile.h"
@@ -216,13 +218,15 @@ TEST_F(ProfileManagerTest, CreateAndUseTwoProfiles) {
// Force lazy-init of some profile services to simulate use.
profile1->CreateHistoryService(true, false);
- EXPECT_TRUE(profile1->GetHistoryService(Profile::EXPLICIT_ACCESS));
+ EXPECT_TRUE(HistoryServiceFactory::GetForProfile(profile1,
+ Profile::EXPLICIT_ACCESS));
profile1->CreateBookmarkModel(true);
EXPECT_TRUE(profile1->GetBookmarkModel());
profile2->CreateBookmarkModel(true);
EXPECT_TRUE(profile2->GetBookmarkModel());
profile2->CreateHistoryService(true, false);
- EXPECT_TRUE(profile2->GetHistoryService(Profile::EXPLICIT_ACCESS));
+ EXPECT_TRUE(HistoryServiceFactory::GetForProfile(profile2,
+ Profile::EXPLICIT_ACCESS));
// Make sure any pending tasks run before we destroy the profiles.
message_loop_.RunAllPending();