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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_APPS_SHORTCUT_MANAGER_FACTORY_H_
6 #define CHROME_BROWSER_APPS_SHORTCUT_MANAGER_FACTORY_H_
8 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
11 template<typename Type
> struct DefaultSingletonTraits
;
16 class AppShortcutManager
;
18 // Singleton that owns all AppShortcutManagers and associates them with
19 // Profiles. Listens for the Profile's destruction notification and cleans up
20 // the associated AppShortcutManager.
21 // AppShortcutManagers should not exist in incognito profiles.
22 class AppShortcutManagerFactory
: public BrowserContextKeyedServiceFactory
{
24 static AppShortcutManager
* GetForProfile(Profile
* profile
);
26 static AppShortcutManagerFactory
* GetInstance();
29 friend struct base::DefaultSingletonTraits
<AppShortcutManagerFactory
>;
31 AppShortcutManagerFactory();
32 ~AppShortcutManagerFactory() override
;
34 // BrowserContextKeyedServiceFactory:
35 KeyedService
* BuildServiceInstanceFor(
36 content::BrowserContext
* profile
) const override
;
37 bool ServiceIsCreatedWithBrowserContext() const override
;
38 bool ServiceIsNULLWhileTesting() const override
;
41 #endif // CHROME_BROWSER_APPS_SHORTCUT_MANAGER_FACTORY_H_