- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / tabs / pinned_tab_service_factory.h
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.
4
5 #ifndef CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_FACTORY_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/memory/singleton.h"
10 #include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
11
12 class PinnedTabService;
13 class Profile;
14
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 {
19  public:
20   // Returns the PinnedTabService that tracks pinning changes for |profile|.
21   static PinnedTabService* GetForProfile(Profile* profile);
22
23   static PinnedTabServiceFactory* GetInstance();
24
25  private:
26   friend struct DefaultSingletonTraits<PinnedTabServiceFactory>;
27
28   PinnedTabServiceFactory();
29   virtual ~PinnedTabServiceFactory();
30
31   // BrowserContextKeyedServiceFactory:
32   virtual BrowserContextKeyedService* BuildServiceInstanceFor(
33       content::BrowserContext* profile) const OVERRIDE;
34   virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
35   virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
36 };
37
38 #endif  // CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_FACTORY_H_