OLD | NEW |
(Empty) | |
| 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 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" |
| 6 |
| 7 #include "chrome/browser/chromeos/file_system_provider/service.h" |
| 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 9 |
| 10 namespace chromeos { |
| 11 namespace file_system_provider { |
| 12 |
| 13 // static |
| 14 Service* ServiceFactory::Get(content::BrowserContext* context) { |
| 15 return static_cast<Service*>( |
| 16 GetInstance()->GetServiceForBrowserContext(context, true)); |
| 17 } |
| 18 |
| 19 ServiceFactory* ServiceFactory::GetInstance() { |
| 20 return Singleton<ServiceFactory>::get(); |
| 21 } |
| 22 |
| 23 ServiceFactory::ServiceFactory() |
| 24 : BrowserContextKeyedServiceFactory( |
| 25 "Service", |
| 26 BrowserContextDependencyManager::GetInstance()) {} |
| 27 |
| 28 ServiceFactory::~ServiceFactory() {} |
| 29 |
| 30 KeyedService* ServiceFactory::BuildServiceInstanceFor( |
| 31 content::BrowserContext* profile) const { |
| 32 return new Service(static_cast<Profile*>(profile)); |
| 33 } |
| 34 |
| 35 bool ServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; } |
| 36 |
| 37 } // namespace file_system_provider |
| 38 } // namespace chromeos |
OLD | NEW |