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