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

Side by Side Diff: chrome/browser/signin/account_tracker_service_factory.cc

Issue 490403002: Revert of Create a new AccountTrackerService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/signin/account_tracker_service_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014 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/signin/account_tracker_service_factory.h"
6
7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 #include "components/pref_registry/pref_registry_syncable.h"
12 #include "components/signin/core/browser/account_tracker_service.h"
13 #include "components/signin/core/browser/profile_oauth2_token_service.h"
14
15 AccountTrackerServiceFactory::AccountTrackerServiceFactory()
16 : BrowserContextKeyedServiceFactory(
17 "AccountTrackerServiceFactory",
18 BrowserContextDependencyManager::GetInstance()) {
19 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
20 }
21
22 AccountTrackerServiceFactory::~AccountTrackerServiceFactory() {
23 }
24
25 // static
26 AccountTrackerService*
27 AccountTrackerServiceFactory::GetForProfile(Profile* profile) {
28 return static_cast<AccountTrackerService*>(
29 GetInstance()->GetServiceForBrowserContext(profile, true));
30 }
31
32 // static
33 AccountTrackerServiceFactory* AccountTrackerServiceFactory::GetInstance() {
34 return Singleton<AccountTrackerServiceFactory>::get();
35 }
36
37 void AccountTrackerServiceFactory::RegisterProfilePrefs(
38 user_prefs::PrefRegistrySyncable* registry) {
39 registry->RegisterListPref(
40 AccountTrackerService::kAccountInfoPref,
41 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
42 }
43
44 KeyedService* AccountTrackerServiceFactory::BuildServiceInstanceFor(
45 content::BrowserContext* context) const {
46 Profile* profile = static_cast<Profile*>(context);
47 AccountTrackerService* service = new AccountTrackerService();
48 service->Initialize(
49 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
50 profile->GetPrefs(),
51 profile->GetRequestContext());
52 return service;
53 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/account_tracker_service_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698