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

Side by Side Diff: chrome/browser/profiles/profile_statistics_factory.cc

Issue 1579433002: Make profile statistics tasks inspectable by tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed ProfileAttributesStorage related functions in profile_statistics.* Created 4 years, 9 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 (c) 2016 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/profiles/profile_statistics_factory.h"
6
7 #include "base/memory/singleton.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_statistics.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 #include "content/public/browser/browser_thread.h"
12
13 // static
14 ProfileStatistics* ProfileStatisticsFactory::GetForProfile(Profile* profile) {
15 return static_cast<ProfileStatistics*>(
16 GetInstance()->GetServiceForBrowserContext(profile, true));
17 }
18
19 // static
20 ProfileStatisticsFactory* ProfileStatisticsFactory::GetInstance() {
21 return base::Singleton<ProfileStatisticsFactory>::get();
22 }
23
24 ProfileStatisticsFactory::ProfileStatisticsFactory()
25 : BrowserContextKeyedServiceFactory("ProfileStatistics",
26 BrowserContextDependencyManager::GetInstance()) {
27 }
28
29 KeyedService* ProfileStatisticsFactory::BuildServiceInstanceFor(
30 content::BrowserContext* context) const {
31 Profile* profile = Profile::FromBrowserContext(context);
32 return new ProfileStatistics(profile);
33 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_statistics_factory.h ('k') | chrome/browser/profiles/profile_statistics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698