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

Unified Diff: chrome/browser/subresource_filter/subresource_filter_profile_context_factory.cc

Issue 2838063002: [on-hold][subresource_filter] Add ActivationTracker to track all activated contents (Closed)
Patch Set: fix incognito Created 3 years, 8 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/browser/subresource_filter/subresource_filter_profile_context_factory.cc
diff --git a/chrome/browser/subresource_filter/subresource_filter_profile_context_factory.cc b/chrome/browser/subresource_filter/subresource_filter_profile_context_factory.cc
index 1d0878d84a0be2f97b5b786dd11256f3963dd432..f172958596a1652b58ad048b0ddc13956e067c0b 100644
--- a/chrome/browser/subresource_filter/subresource_filter_profile_context_factory.cc
+++ b/chrome/browser/subresource_filter/subresource_filter_profile_context_factory.cc
@@ -5,15 +5,17 @@
#include "chrome/browser/subresource_filter/subresource_filter_profile_context_factory.h"
#include "base/memory/singleton.h"
+#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/subresource_filter/subresource_filter_profile_context.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/keyed_service.h"
// static
-void SubresourceFilterProfileContextFactory::EnsureForProfile(
- Profile* profile) {
- GetInstance()->GetServiceForBrowserContext(profile, true /* create */);
+SubresourceFilterProfileContext*
+SubresourceFilterProfileContextFactory::GetForProfile(Profile* profile) {
+ return static_cast<SubresourceFilterProfileContext*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true /* create */));
}
// static
@@ -31,3 +33,9 @@ KeyedService* SubresourceFilterProfileContextFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
return new SubresourceFilterProfileContext(static_cast<Profile*>(profile));
}
+
+content::BrowserContext*
+SubresourceFilterProfileContextFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return chrome::GetBrowserContextOwnInstanceInIncognito(context);
+}

Powered by Google App Engine
This is Rietveld 408576698