Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / engagement / site_engagement_service_factory.cc
blob882e375ccc2f78b74e07c21eb779254ff9e395f0
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/engagement/site_engagement_service.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 // static
12 SiteEngagementService* SiteEngagementServiceFactory::GetForProfile(
13 Profile* profile) {
14 return static_cast<SiteEngagementService*>(
15 GetInstance()->GetServiceForBrowserContext(profile, true));
18 // static
19 SiteEngagementServiceFactory* SiteEngagementServiceFactory::GetInstance() {
20 return base::Singleton<SiteEngagementServiceFactory>::get();
23 SiteEngagementServiceFactory::SiteEngagementServiceFactory()
24 : BrowserContextKeyedServiceFactory(
25 "SiteEngagementService",
26 BrowserContextDependencyManager::GetInstance()) {
29 SiteEngagementServiceFactory::~SiteEngagementServiceFactory() {
32 bool SiteEngagementServiceFactory::ServiceIsNULLWhileTesting() const {
33 return true;
36 KeyedService* SiteEngagementServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* profile) const {
38 return new SiteEngagementService(static_cast<Profile*>(profile));