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

Side by Side Diff: chrome/browser/managed_mode/managed_user_service_factory.cc

Issue 148083014: ExtensionSystem cleanup part 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac Created 6 years, 10 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/managed_mode/managed_user_service_factory.h" 5 #include "chrome/browser/managed_mode/managed_user_service_factory.h"
6 6
7 #include "chrome/browser/extensions/extension_system_factory.h"
8 #include "chrome/browser/managed_mode/managed_user_service.h" 7 #include "chrome/browser/managed_mode/managed_user_service.h"
9 #include "chrome/browser/profiles/incognito_helpers.h" 8 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
12 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 11 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
12 #include "extensions/browser/extension_system_provider.h"
13 #include "extensions/browser/extensions_browser_client.h"
13 14
14 // static 15 // static
15 ManagedUserService* ManagedUserServiceFactory::GetForProfile(Profile* profile) { 16 ManagedUserService* ManagedUserServiceFactory::GetForProfile(Profile* profile) {
16 return static_cast<ManagedUserService*>( 17 return static_cast<ManagedUserService*>(
17 GetInstance()->GetServiceForBrowserContext(profile, true)); 18 GetInstance()->GetServiceForBrowserContext(profile, true));
18 } 19 }
19 20
20 // static 21 // static
21 ManagedUserServiceFactory* ManagedUserServiceFactory::GetInstance() { 22 ManagedUserServiceFactory* ManagedUserServiceFactory::GetInstance() {
22 return Singleton<ManagedUserServiceFactory>::get(); 23 return Singleton<ManagedUserServiceFactory>::get();
23 } 24 }
24 25
25 // static 26 // static
26 BrowserContextKeyedService* ManagedUserServiceFactory::BuildInstanceFor( 27 BrowserContextKeyedService* ManagedUserServiceFactory::BuildInstanceFor(
27 Profile* profile) { 28 Profile* profile) {
28 return new ManagedUserService(profile); 29 return new ManagedUserService(profile);
29 } 30 }
30 31
31 ManagedUserServiceFactory::ManagedUserServiceFactory() 32 ManagedUserServiceFactory::ManagedUserServiceFactory()
32 : BrowserContextKeyedServiceFactory( 33 : BrowserContextKeyedServiceFactory(
33 "ManagedUserService", 34 "ManagedUserService",
34 BrowserContextDependencyManager::GetInstance()) { 35 BrowserContextDependencyManager::GetInstance()) {
35 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); 36 DependsOn(
37 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
36 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); 38 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
37 } 39 }
38 40
39 ManagedUserServiceFactory::~ManagedUserServiceFactory() {} 41 ManagedUserServiceFactory::~ManagedUserServiceFactory() {}
40 42
41 content::BrowserContext* ManagedUserServiceFactory::GetBrowserContextToUse( 43 content::BrowserContext* ManagedUserServiceFactory::GetBrowserContextToUse(
42 content::BrowserContext* context) const { 44 content::BrowserContext* context) const {
43 return chrome::GetBrowserContextRedirectedInIncognito(context); 45 return chrome::GetBrowserContextRedirectedInIncognito(context);
44 } 46 }
45 47
46 BrowserContextKeyedService* ManagedUserServiceFactory::BuildServiceInstanceFor( 48 BrowserContextKeyedService* ManagedUserServiceFactory::BuildServiceInstanceFor(
47 content::BrowserContext* profile) const { 49 content::BrowserContext* profile) const {
48 return BuildInstanceFor(static_cast<Profile*>(profile)); 50 return BuildInstanceFor(static_cast<Profile*>(profile));
49 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698