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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 10828263: Moving FaviconService to a ProfileKeyedService. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: resyncing with library after revert Created 8 years, 4 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
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
===================================================================
--- chrome/test/base/testing_profile.cc (revision 152993)
+++ chrome/test/base/testing_profile.cc (working copy)
@@ -24,6 +24,7 @@
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/favicon/favicon_service.h"
+#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_backend.h"
@@ -297,14 +298,20 @@
host_content_settings_map_->ShutdownOnUIThread();
DestroyTopSites();
- DestroyFaviconService();
if (pref_proxy_config_tracker_.get())
pref_proxy_config_tracker_->DetachFromPrefService();
}
+static ProfileKeyedService* BuildFaviconService(Profile* profile) {
+ return new FaviconService(
+ HistoryServiceFactory::GetForProfileWithoutCreating(profile));
+}
+
void TestingProfile::CreateFaviconService() {
- favicon_service_.reset(new FaviconService(this));
+ // It is up to the caller to create the history service if one is needed.
+ FaviconServiceFactory::GetInstance()->SetTestingFactory(
+ this, BuildFaviconService);
}
static scoped_refptr<RefcountedProfileKeyedService> BuildHistoryService(
@@ -372,10 +379,6 @@
}
}
-void TestingProfile::DestroyFaviconService() {
- favicon_service_.reset();
-}
-
static ProfileKeyedService* BuildBookmarkModel(Profile* profile) {
BookmarkModel* bookmark_model = new BookmarkModel(profile);
bookmark_model->Load();
@@ -520,10 +523,6 @@
return extension_special_storage_policy_.get();
}
-FaviconService* TestingProfile::GetFaviconService(ServiceAccessType access) {
- return favicon_service_.get();
-}
-
net::CookieMonster* TestingProfile::GetCookieMonster() {
if (!GetRequestContext())
return NULL;
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698