Home | History | Annotate | Download | only in dial
      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_EXTENSIONS_API_DIAL_DIAL_API_FACTORY_H_
      6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_FACTORY_H_
      7 
      8 #include "base/memory/singleton.h"
      9 #include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h"
     10 
     11 class Profile;
     12 
     13 namespace extensions {
     14 
     15 class DialAPI;
     16 
     17 class DialAPIFactory : public RefcountedBrowserContextKeyedServiceFactory {
     18  public:
     19   static scoped_refptr<DialAPI> GetForProfile(Profile* profile);
     20 
     21   static DialAPIFactory* GetInstance();
     22 
     23  private:
     24   friend struct DefaultSingletonTraits<DialAPIFactory>;
     25 
     26   DialAPIFactory();
     27   virtual ~DialAPIFactory();
     28 
     29   // BrowserContextKeyedServiceFactory:
     30   virtual scoped_refptr<RefcountedBrowserContextKeyedService>
     31       BuildServiceInstanceFor(content::BrowserContext* profile) const OVERRIDE;
     32   virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
     33   virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
     34 
     35   DISALLOW_COPY_AND_ASSIGN(DialAPIFactory);
     36 };
     37 
     38 }  // namespace extensions
     39 
     40 #endif  // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_FACTORY_H_
     41