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

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: Making FallbackIconSource take FallbackIconService directly. 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
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index f77bdee6c570c22e738017d1224ebc2b98dd0962..2f290512c0ececce06fd5f45d8199d14d613b5ef 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -19,6 +19,8 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/favicon/chrome_favicon_client_factory.h"
+#include "chrome/browser/favicon/fallback_icon_service.h"
+#include "chrome/browser/favicon/fallback_icon_service_factory.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/chrome_history_client.h"
@@ -211,6 +213,13 @@ KeyedService* CreateTestDesktopNotificationService(
}
#endif
+KeyedService* BuildFallbackIconService(content::BrowserContext* profile) {
+ FallbackIconClient* fallback_icon_client =
+ ChromeFallbackIconClientFactory::GetForProfile(
+ static_cast<Profile*>(profile));
sdefresne 2015/03/17 09:41:52 nit: Profile::FromBrowserContext(profile)
huangs 2015/03/23 03:28:35 Done.
+ return new FallbackIconService(fallback_icon_client);
+}
+
KeyedService* BuildFaviconService(content::BrowserContext* profile) {
FaviconClient* favicon_client =
ChromeFaviconClientFactory::GetForProfile(static_cast<Profile*>(profile));
@@ -554,6 +563,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(

Powered by Google App Engine
This is Rietveld 408576698