Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / chrome / browser / engagement / site_engagement_service_factory.cc
blob3dc054f235d296c25fb8e5d8a2f53954d4cfd915
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/engagement/site_engagement_service_factory.h"
7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
8 #include "chrome/browser/engagement/site_engagement_service.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 // static
13 SiteEngagementService* SiteEngagementServiceFactory::GetForProfile(
14 Profile* profile) {
15 return static_cast<SiteEngagementService*>(
16 GetInstance()->GetServiceForBrowserContext(profile, true));
19 // static
20 SiteEngagementServiceFactory* SiteEngagementServiceFactory::GetInstance() {
21 return base::Singleton<SiteEngagementServiceFactory>::get();
24 SiteEngagementServiceFactory::SiteEngagementServiceFactory()
25 : BrowserContextKeyedServiceFactory(
26 "SiteEngagementService",
27 BrowserContextDependencyManager::GetInstance()) {
28 DependsOn(HostContentSettingsMapFactory::GetInstance());
31 SiteEngagementServiceFactory::~SiteEngagementServiceFactory() {
34 bool SiteEngagementServiceFactory::ServiceIsNULLWhileTesting() const {
35 return true;
38 KeyedService* SiteEngagementServiceFactory::BuildServiceInstanceFor(
39 content::BrowserContext* profile) const {
40 return new SiteEngagementService(static_cast<Profile*>(profile));