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/service_registration_manager_test_api.h" |
| 6 |
| 7 namespace extensions { |
| 8 namespace internal { |
| 9 |
| 10 TestServiceRegistrationManager::TestServiceRegistrationManager() { |
| 11 } |
| 12 |
| 13 TestServiceRegistrationManager::~TestServiceRegistrationManager() { |
| 14 } |
| 15 |
| 16 void TestServiceRegistrationManager::AddServiceToServiceRegistry( |
| 17 content::ServiceRegistry* service_registry, |
| 18 ServiceFactoryBase* factory) { |
| 19 auto test_factory = test_factories_.find(factory->GetName()); |
| 20 if (test_factory != test_factories_.end()) { |
| 21 test_factory->second->Register(service_registry); |
| 22 } else { |
| 23 ServiceRegistrationManager::AddServiceToServiceRegistry(service_registry, |
| 24 factory); |
| 25 } |
| 26 } |
| 27 |
| 28 } // namespace internal |
| 29 |
| 30 ServiceRegistrationManagerTestApi::ServiceRegistrationManagerTestApi() { |
| 31 ServiceRegistrationManager::SetServiceRegistrationManagerForTest( |
| 32 &service_registration_manager_); |
| 33 } |
| 34 |
| 35 ServiceRegistrationManagerTestApi::~ServiceRegistrationManagerTestApi() { |
| 36 ServiceRegistrationManager::ClearServiceRegistrationManagerForTest(); |
| 37 } |
| 38 |
| 39 } // namespace extensions |
OLD | NEW |