Home | History | Annotate | Download | only in tabs
      1 // Copyright (c) 2011 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_TABS_PINNED_TAB_SERVICE_FACTORY_H_
      6 #define CHROME_BROWSER_TABS_PINNED_TAB_SERVICE_FACTORY_H_
      7 
      8 #include "base/compiler_specific.h"
      9 #include "base/memory/singleton.h"
     10 #include "chrome/browser/profiles/profile_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 ProfileKeyedServiceFactory {
     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   // ProfileKeyedServiceFactory:
     32   virtual ProfileKeyedService* BuildServiceInstanceFor(
     33       Profile* profile) const OVERRIDE;
     34 };
     35 
     36 #endif  // CHROME_BROWSER_TABS_PINNED_TAB_SERVICE_FACTORY_H_
     37