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 #ifndef APPS_SHORTCUT_MANAGER_FACTORY_H_ | 5 #ifndef APPS_SHORTCUT_MANAGER_FACTORY_H_ |
6 #define APPS_SHORTCUT_MANAGER_FACTORY_H_ | 6 #define APPS_SHORTCUT_MANAGER_FACTORY_H_ |
7 | 7 |
8 #include "components/browser_context_keyed_service/browser_context_keyed_service
_factory.h" | 8 #include "components/browser_context_keyed_service/browser_context_keyed_service
_factory.h" |
9 | 9 |
10 template<typename Type> struct DefaultSingletonTraits; | 10 template<typename Type> struct DefaultSingletonTraits; |
11 | 11 |
12 class Profile; | 12 class Profile; |
13 | 13 |
14 namespace apps { | 14 namespace apps { |
15 | 15 |
16 class ShortcutManager; | 16 class ShortcutManager; |
17 | 17 |
18 // Singleton that owns all ShortcutManagers and associates them with | 18 // Singleton that owns all ShortcutManagers and associates them with |
19 // Profiles. Listens for the Profile's destruction notification and cleans up | 19 // Profiles. Listens for the Profile's destruction notification and cleans up |
20 // the associated ShortcutManager. | 20 // the associated ShortcutManager. |
21 // ShortcutManagers should not exist in incognito profiles. | 21 // ShortcutManagers should not exist in incognito profiles. |
22 class ShortcutManagerFactory : public ProfileKeyedServiceFactory { | 22 class ShortcutManagerFactory : public BrowserContextKeyedServiceFactory { |
23 public: | 23 public: |
24 static ShortcutManager* GetForProfile(Profile* profile); | 24 static ShortcutManager* GetForProfile(Profile* profile); |
25 | 25 |
26 static void ResetForProfile(Profile* profile); | 26 static void ResetForProfile(Profile* profile); |
27 | 27 |
28 static ShortcutManagerFactory* GetInstance(); | 28 static ShortcutManagerFactory* GetInstance(); |
29 | 29 |
30 private: | 30 private: |
31 friend struct DefaultSingletonTraits<ShortcutManagerFactory>; | 31 friend struct DefaultSingletonTraits<ShortcutManagerFactory>; |
32 | 32 |
33 ShortcutManagerFactory(); | 33 ShortcutManagerFactory(); |
34 virtual ~ShortcutManagerFactory(); | 34 virtual ~ShortcutManagerFactory(); |
35 | 35 |
36 // ProfileKeyedServiceFactory: | 36 // BrowserContextKeyedServiceFactory: |
37 virtual ProfileKeyedService* BuildServiceInstanceFor( | 37 virtual BrowserContextKeyedService* BuildServiceInstanceFor( |
38 content::BrowserContext* profile) const OVERRIDE; | 38 content::BrowserContext* profile) const OVERRIDE; |
39 virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; | 39 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; |
40 }; | 40 }; |
41 | 41 |
42 } // namespace apps | 42 } // namespace apps |
43 | 43 |
44 #endif // APPS_SHORTCUT_MANAGER_FACTORY_H_ | 44 #endif // APPS_SHORTCUT_MANAGER_FACTORY_H_ |
OLD | NEW |