Home | History | Annotate | Download | only in history
      1 // Copyright 2014 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_HISTORY_CHROME_HISTORY_CLIENT_FACTORY_H_
      6 #define CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_FACTORY_H_
      7 
      8 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
      9 
     10 template <typename T>
     11 struct DefaultSingletonTraits;
     12 
     13 class ChromeHistoryClient;
     14 class Profile;
     15 
     16 // Singleton that owns all ChromeHistoryClients and associates them with
     17 // Profiles.
     18 class ChromeHistoryClientFactory : public BrowserContextKeyedServiceFactory {
     19  public:
     20   static ChromeHistoryClient* GetForProfile(Profile* profile);
     21 
     22   static ChromeHistoryClientFactory* GetInstance();
     23 
     24  private:
     25   friend struct DefaultSingletonTraits<ChromeHistoryClientFactory>;
     26 
     27   ChromeHistoryClientFactory();
     28   virtual ~ChromeHistoryClientFactory();
     29 
     30   // BrowserContextKeyedServiceFactory:
     31   virtual KeyedService* BuildServiceInstanceFor(
     32       content::BrowserContext* context) const OVERRIDE;
     33   virtual content::BrowserContext* GetBrowserContextToUse(
     34       content::BrowserContext* context) const OVERRIDE;
     35   virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
     36 };
     37 
     38 #endif  // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_FACTORY_H_
     39