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

Side by Side Diff: chrome/browser/extensions/install_tracker_factory.cc

Issue 197413002: Move extensions-related files to using //components/keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 | 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/extensions/install_tracker_factory.h" 5 #include "chrome/browser/extensions/install_tracker_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/browser/extensions/extension_system_factory.h" 8 #include "chrome/browser/extensions/extension_system_factory.h"
9 #include "chrome/browser/extensions/install_tracker.h" 9 #include "chrome/browser/extensions/install_tracker.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 #include "extensions/browser/extension_prefs.h" 12 #include "extensions/browser/extension_prefs.h"
13 #include "extensions/browser/extension_prefs_factory.h" 13 #include "extensions/browser/extension_prefs_factory.h"
14 #include "extensions/browser/extensions_browser_client.h" 14 #include "extensions/browser/extensions_browser_client.h"
15 15
16 namespace extensions { 16 namespace extensions {
17 17
18 // static 18 // static
19 InstallTracker* InstallTrackerFactory::GetForProfile(Profile* profile) { 19 InstallTracker* InstallTrackerFactory::GetForProfile(Profile* profile) {
20 return static_cast<InstallTracker*>( 20 return static_cast<InstallTracker*>(
21 GetInstance()->GetServiceForBrowserContext(profile, true)); 21 GetInstance()->GetServiceForBrowserContext(profile, true));
22 } 22 }
23 23
24 InstallTrackerFactory* InstallTrackerFactory::GetInstance() { 24 InstallTrackerFactory* InstallTrackerFactory::GetInstance() {
25 return Singleton<InstallTrackerFactory>::get(); 25 return Singleton<InstallTrackerFactory>::get();
26 } 26 }
27 27
28 InstallTrackerFactory::InstallTrackerFactory() 28 InstallTrackerFactory::InstallTrackerFactory()
29 : BrowserContextKeyedServiceFactory( 29 : BrowserContextKeyedServiceFactory(
30 "InstallTracker", 30 "InstallTracker",
31 BrowserContextDependencyManager::GetInstance()) { 31 BrowserContextDependencyManager::GetInstance()) {
32 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); 32 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
33 DependsOn(ExtensionPrefsFactory::GetInstance()); 33 DependsOn(ExtensionPrefsFactory::GetInstance());
34 } 34 }
35 35
36 InstallTrackerFactory::~InstallTrackerFactory() { 36 InstallTrackerFactory::~InstallTrackerFactory() {
37 } 37 }
38 38
39 BrowserContextKeyedService* InstallTrackerFactory::BuildServiceInstanceFor( 39 KeyedService* InstallTrackerFactory::BuildServiceInstanceFor(
40 content::BrowserContext* context) const { 40 content::BrowserContext* context) const {
41 Profile* profile = Profile::FromBrowserContext(context); 41 Profile* profile = Profile::FromBrowserContext(context);
42 return new InstallTracker(profile, ExtensionPrefs::Get(context)); 42 return new InstallTracker(profile, ExtensionPrefs::Get(context));
43 } 43 }
44 44
45 content::BrowserContext* InstallTrackerFactory::GetBrowserContextToUse( 45 content::BrowserContext* InstallTrackerFactory::GetBrowserContextToUse(
46 content::BrowserContext* context) const { 46 content::BrowserContext* context) const {
47 // The installs themselves are routed to the non-incognito profile and so 47 // The installs themselves are routed to the non-incognito profile and so
48 // should the install progress. 48 // should the install progress.
49 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); 49 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
50 } 50 }
51 51
52 } // namespace extensions 52 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/install_tracker_factory.h ('k') | chrome/browser/extensions/menu_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698