| 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 "extensions/test/test_service_registration_manager.h" | |
| 6 | |
| 7 namespace extensions { | |
| 8 | |
| 9 TestServiceRegistrationManager::TestServiceRegistrationManager() { | |
| 10 ServiceRegistrationManager::SetServiceRegistrationManagerForTest(this); | |
| 11 } | |
| 12 | |
| 13 TestServiceRegistrationManager::~TestServiceRegistrationManager() { | |
| 14 ServiceRegistrationManager::SetServiceRegistrationManagerForTest(nullptr); | |
| 15 } | |
| 16 | |
| 17 void TestServiceRegistrationManager::AddServiceToServiceRegistry( | |
| 18 content::ServiceRegistry* service_registry, | |
| 19 internal::ServiceFactoryBase* factory) { | |
| 20 auto test_factory = test_factories_.find(factory->GetName()); | |
| 21 if (test_factory != test_factories_.end()) { | |
| 22 test_factory->second->Register(service_registry); | |
| 23 } else { | |
| 24 ServiceRegistrationManager::AddServiceToServiceRegistry(service_registry, | |
| 25 factory); | |
| 26 } | |
| 27 } | |
| 28 | |
| 29 } // namespace extensions | |
| OLD | NEW |