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_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_
8 #include "base/memory/singleton.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
13 class WebHistoryService;
16 // Used for creating and fetching a per-profile instance of the
18 class WebHistoryServiceFactory : public BrowserContextKeyedServiceFactory {
20 // Get the singleton instance of the factory.
21 static WebHistoryServiceFactory* GetInstance();
23 // Get the WebHistoryService for |profile|, creating one if needed.
24 static history::WebHistoryService* GetForProfile(Profile* profile);
27 // Overridden from BrowserContextKeyedServiceFactory.
28 virtual BrowserContextKeyedService* BuildServiceInstanceFor(
29 content::BrowserContext* context) const OVERRIDE;
32 friend struct DefaultSingletonTraits<WebHistoryServiceFactory>;
34 explicit WebHistoryServiceFactory();
35 virtual ~WebHistoryServiceFactory();
37 DISALLOW_COPY_AND_ASSIGN(WebHistoryServiceFactory);
40 #endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_