1 // Copyright 2013 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 #include "chrome/browser/ui/app_list/search/history_factory.h"
7 #include "base/memory/singleton.h"
8 #include "chrome/browser/ui/app_list/search/history.h"
9 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
14 HistoryFactory* HistoryFactory::GetInstance() {
15 return Singleton<HistoryFactory>::get();
19 History* HistoryFactory::GetForBrowserContext(
20 content::BrowserContext* context) {
21 return static_cast<History*>(
22 GetInstance()->GetServiceForBrowserContext(context, true));
25 HistoryFactory::HistoryFactory()
26 : BrowserContextKeyedServiceFactory(
28 BrowserContextDependencyManager::GetInstance()) {}
30 HistoryFactory::~HistoryFactory() {}
32 BrowserContextKeyedService* HistoryFactory::BuildServiceInstanceFor(
33 content::BrowserContext* context) const {
34 return new History(context);
37 } // namespace app_list