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

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

Issue 996253002: [Fallback Icons] Refactor FallbackIconService to be a BrowserContext-level singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing FallbackIconSource::SendNotFoundResponse(). Created 5 years, 9 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') | components/favicon.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 004a73ceaee378c502170e11c465f7d773876254..d33aeefbf4533ab521a328a0dcf8e1e26bdf6a2d 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -20,7 +20,9 @@
#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/favicon/chrome_fallback_icon_client_factory.h"
#include "chrome/browser/favicon/chrome_favicon_client_factory.h"
+#include "chrome/browser/favicon/fallback_icon_service_factory.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/chrome_history_client.h"
#include "chrome/browser/history/chrome_history_client_factory.h"
@@ -54,6 +56,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/common/bookmark_constants.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
+#include "components/favicon/core/fallback_icon_service.h"
#include "components/favicon/core/favicon_service.h"
#include "components/history/content/browser/content_visit_delegate.h"
#include "components/history/content/browser/history_database_helper.h"
@@ -213,6 +216,12 @@ KeyedService* CreateTestDesktopNotificationService(
}
#endif
+KeyedService* BuildFallbackIconService(content::BrowserContext* context) {
+ Profile* profile = Profile::FromBrowserContext(context);
+ return new FallbackIconService(
+ ChromeFallbackIconClientFactory::GetForBrowserContext(profile));
+}
+
KeyedService* BuildFaviconService(content::BrowserContext* context) {
Profile* profile = Profile::FromBrowserContext(context);
return new FaviconService(ChromeFaviconClientFactory::GetForProfile(profile),
@@ -570,6 +579,11 @@ TestingProfile::~TestingProfile() {
}
}
+void TestingProfile::CreateFallbackIconService() {
+ FaviconServiceFactory::GetInstance()->SetTestingFactory(
+ this, BuildFallbackIconService);
+}
+
void TestingProfile::CreateFaviconService() {
// It is up to the caller to create the history service if one is needed.
FaviconServiceFactory::GetInstance()->SetTestingFactory(
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | components/favicon.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698