OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "apps/shortcut_manager_factory.h" | 5 #include "apps/shortcut_manager_factory.h" |
6 | 6 |
7 #include "apps/shortcut_manager.h" | 7 #include "apps/shortcut_manager.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 9 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
10 | 10 |
11 namespace apps { | 11 namespace apps { |
12 | 12 |
13 // static | 13 // static |
14 ShortcutManager* ShortcutManagerFactory::GetForProfile(Profile* profile) { | 14 ShortcutManager* ShortcutManagerFactory::GetForProfile(Profile* profile) { |
15 return static_cast<ShortcutManager*>( | 15 return static_cast<ShortcutManager*>( |
16 GetInstance()->GetServiceForProfile(profile, true)); | 16 GetInstance()->GetServiceForBrowserContext(profile, true)); |
17 } | 17 } |
18 | 18 |
19 // static | 19 // static |
20 void ShortcutManagerFactory::ResetForProfile(Profile* profile) { | 20 void ShortcutManagerFactory::ResetForProfile(Profile* profile) { |
21 ShortcutManagerFactory* factory = GetInstance(); | 21 ShortcutManagerFactory* factory = GetInstance(); |
22 factory->ProfileShutdown(profile); | 22 factory->BrowserContextShutdown(profile); |
23 factory->ProfileDestroyed(profile); | 23 factory->BrowserContextDestroyed(profile); |
24 } | 24 } |
25 | 25 |
26 ShortcutManagerFactory* ShortcutManagerFactory::GetInstance() { | 26 ShortcutManagerFactory* ShortcutManagerFactory::GetInstance() { |
27 return Singleton<ShortcutManagerFactory>::get(); | 27 return Singleton<ShortcutManagerFactory>::get(); |
28 } | 28 } |
29 | 29 |
30 ShortcutManagerFactory::ShortcutManagerFactory() | 30 ShortcutManagerFactory::ShortcutManagerFactory() |
31 : ProfileKeyedServiceFactory("ShortcutManager", | 31 : BrowserContextKeyedServiceFactory( |
32 ProfileDependencyManager::GetInstance()) { | 32 "ShortcutManager", |
| 33 BrowserContextDependencyManager::GetInstance()) { |
33 } | 34 } |
34 | 35 |
35 ShortcutManagerFactory::~ShortcutManagerFactory() { | 36 ShortcutManagerFactory::~ShortcutManagerFactory() { |
36 } | 37 } |
37 | 38 |
38 ProfileKeyedService* ShortcutManagerFactory::BuildServiceInstanceFor( | 39 BrowserContextKeyedService* ShortcutManagerFactory::BuildServiceInstanceFor( |
39 content::BrowserContext* profile) const { | 40 content::BrowserContext* profile) const { |
40 return new ShortcutManager(static_cast<Profile*>(profile)); | 41 return new ShortcutManager(static_cast<Profile*>(profile)); |
41 } | 42 } |
42 | 43 |
43 bool ShortcutManagerFactory::ServiceIsCreatedWithProfile() const { | 44 bool ShortcutManagerFactory::ServiceIsCreatedWithBrowserContext() const { |
44 return true; | 45 return true; |
45 } | 46 } |
46 | 47 |
47 } // namespace apps | 48 } // namespace apps |
OLD | NEW |