1 // Copyright (c) 2012 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_UI_TABS_PINNED_TAB_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_FACTORY_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/singleton.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
12 class PinnedTabService
;
15 // Singleton that owns all PinnedTabServices and associates them with Profiles.
16 // Listens for the Profile's destruction notification and cleans up the
17 // associated PinnedTabService.
18 class PinnedTabServiceFactory
: public BrowserContextKeyedServiceFactory
{
20 // Returns the PinnedTabService that tracks pinning changes for |profile|.
21 static PinnedTabService
* GetForProfile(Profile
* profile
);
23 static PinnedTabServiceFactory
* GetInstance();
26 friend struct base::DefaultSingletonTraits
<PinnedTabServiceFactory
>;
28 PinnedTabServiceFactory();
29 ~PinnedTabServiceFactory() override
;
31 // BrowserContextKeyedServiceFactory:
32 KeyedService
* BuildServiceInstanceFor(
33 content::BrowserContext
* profile
) const override
;
34 bool ServiceIsCreatedWithBrowserContext() const override
;
35 bool ServiceIsNULLWhileTesting() const override
;
38 #endif // CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_FACTORY_H_