OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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/chromeos/extensions/networking_private_api_factory.h" |
| 6 |
| 7 #include "chrome/browser/chromeos/extensions/networking_private_api.h" |
| 8 #include "chrome/browser/extensions/extension_system_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 11 |
| 12 namespace chromeos { |
| 13 |
| 14 // static |
| 15 NetworkingPrivateAPI* NetworkingPrivateAPIFactory::GetForProfile( |
| 16 Profile* profile) { |
| 17 return static_cast<NetworkingPrivateAPI*>( |
| 18 GetInstance()->GetServiceForProfile(profile, true)); |
| 19 } |
| 20 |
| 21 // static |
| 22 NetworkingPrivateAPIFactory* NetworkingPrivateAPIFactory::GetInstance() { |
| 23 return Singleton<NetworkingPrivateAPIFactory>::get(); |
| 24 } |
| 25 |
| 26 NetworkingPrivateAPIFactory::NetworkingPrivateAPIFactory() |
| 27 : ProfileKeyedServiceFactory( |
| 28 "NetworkingPrivateAPI", |
| 29 ProfileDependencyManager::GetInstance()) { |
| 30 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); |
| 31 } |
| 32 |
| 33 NetworkingPrivateAPIFactory::~NetworkingPrivateAPIFactory() { |
| 34 } |
| 35 |
| 36 ProfileKeyedService* NetworkingPrivateAPIFactory::BuildServiceInstanceFor( |
| 37 Profile* profile) const { |
| 38 return new NetworkingPrivateAPI(profile); |
| 39 } |
| 40 |
| 41 bool NetworkingPrivateAPIFactory::ServiceHasOwnInstanceInIncognito() const { |
| 42 // Explicitly and always allow this service in guest login mode. See |
| 43 // chrome/browser/profiles/profile_keyed_base_factory.h comment |
| 44 // for the details. |
| 45 return true; |
| 46 } |
| 47 |
| 48 bool NetworkingPrivateAPIFactory::ServiceIsCreatedWithProfile() const { |
| 49 return true; |
| 50 } |
| 51 |
| 52 bool NetworkingPrivateAPIFactory::ServiceIsNULLWhileTesting() const { |
| 53 return true; |
| 54 } |
| 55 |
| 56 } // namespace chromeos |
| 57 |
OLD | NEW |