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

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

Issue 2829313002: Add SubresourceFilterProfileContext for all profile scoped context (Closed)
Patch Set: engedy review 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
new file mode 100644
index 0000000000000000000000000000000000000000..1d0878d84a0be2f97b5b786dd11256f3963dd432
--- /dev/null
+++ b/chrome/browser/subresource_filter/subresource_filter_profile_context_factory.cc
@@ -0,0 +1,33 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/subresource_filter/subresource_filter_profile_context_factory.h"
+
+#include "base/memory/singleton.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 */);
+}
+
+// static
+SubresourceFilterProfileContextFactory*
+SubresourceFilterProfileContextFactory::GetInstance() {
+ return base::Singleton<SubresourceFilterProfileContextFactory>::get();
+}
+
+SubresourceFilterProfileContextFactory::SubresourceFilterProfileContextFactory()
+ : BrowserContextKeyedServiceFactory(
+ "SubresourceFilterProfileContext",
+ BrowserContextDependencyManager::GetInstance()) {}
+
+KeyedService* SubresourceFilterProfileContextFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new SubresourceFilterProfileContext(static_cast<Profile*>(profile));
+}
« no previous file with comments | « chrome/browser/subresource_filter/subresource_filter_profile_context_factory.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698