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

Side by Side Diff: chrome/browser/engagement/site_engagement_service_factory.cc

Issue 1077063002: Implement a basic Site Engagement Score service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "chrome/browser/engagement/site_engagement_service_factory.h"
6
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"
10
11 // static
12 SiteEngagementService* SiteEngagementServiceFactory::GetForProfile(
13 Profile* profile) {
14 return static_cast<SiteEngagementService*>(
15 GetInstance()->GetServiceForBrowserContext(profile, true));
16 }
17
18 // static
19 SiteEngagementServiceFactory* SiteEngagementServiceFactory::GetInstance() {
20 return Singleton<SiteEngagementServiceFactory>::get();
21 }
22
23 SiteEngagementServiceFactory::SiteEngagementServiceFactory()
24 : BrowserContextKeyedServiceFactory(
25 "SiteEngagementService",
26 BrowserContextDependencyManager::GetInstance()) {
27 }
28
29 SiteEngagementServiceFactory::~SiteEngagementServiceFactory() {
30 }
31
32 bool SiteEngagementServiceFactory::ServiceIsNULLWhileTesting() const {
33 return true;
34 }
35
36 KeyedService* SiteEngagementServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* profile) const {
38 return new SiteEngagementService(static_cast<Profile*>(profile));
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698