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. 4 5#include "chrome/browser/ui/app_list/search/common/webservice_cache_factory.h" 6 7#include "base/memory/singleton.h" 8#include "chrome/browser/ui/app_list/search/common/webservice_cache.h" 9#include "components/keyed_service/content/browser_context_dependency_manager.h" 10 11namespace app_list { 12 13// static 14WebserviceCacheFactory* WebserviceCacheFactory::GetInstance() { 15 return Singleton<WebserviceCacheFactory>::get(); 16} 17 18// static 19WebserviceCache* WebserviceCacheFactory::GetForBrowserContext( 20 content::BrowserContext* context) { 21 return static_cast<WebserviceCache*>( 22 GetInstance()->GetServiceForBrowserContext(context, true)); 23} 24 25WebserviceCacheFactory::WebserviceCacheFactory() 26 : BrowserContextKeyedServiceFactory( 27 "app_list::WebserviceCache", 28 BrowserContextDependencyManager::GetInstance()) {} 29 30WebserviceCacheFactory::~WebserviceCacheFactory() {} 31 32KeyedService* WebserviceCacheFactory::BuildServiceInstanceFor( 33 content::BrowserContext* context) const { 34 return new WebserviceCache(context); 35} 36 37} // namespace app_list 38