Chromium Code Reviews| Index: chrome/browser/chromeos/extensions/networking_private_api_factory.cc |
| diff --git a/chrome/browser/chromeos/extensions/networking_private_api_factory.cc b/chrome/browser/chromeos/extensions/networking_private_api_factory.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..dd628835c0978af4a4cb33f4884334fe0ee330b8 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/extensions/networking_private_api_factory.cc |
| @@ -0,0 +1,57 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/chromeos/extensions/networking_private_api_factory.h" |
| + |
| +#include "chrome/browser/chromeos/extensions/networking_private_api.h" |
| +#include "chrome/browser/extensions/extension_system_factory.h" |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/profiles/profile_dependency_manager.h" |
| + |
| +namespace chromeos { |
| + |
| +// static |
| +NetworkingPrivateAPI* NetworkingPrivateAPIFactory::GetForProfile( |
| + Profile* profile) { |
| + return static_cast<NetworkingPrivateAPI*>( |
| + GetInstance()->GetServiceForProfile(profile, true)); |
| +} |
| + |
| +// static |
| +NetworkingPrivateAPIFactory* NetworkingPrivateAPIFactory::GetInstance() { |
| + return Singleton<NetworkingPrivateAPIFactory>::get(); |
| +} |
| + |
| +NetworkingPrivateAPIFactory::NetworkingPrivateAPIFactory() |
| + : ProfileKeyedServiceFactory( |
| + "NetworkingPrivateAPI", |
| + ProfileDependencyManager::GetInstance()) { |
| + DependsOn(extensions::ExtensionSystemFactory::GetInstance()); |
| +} |
| + |
| +NetworkingPrivateAPIFactory::~NetworkingPrivateAPIFactory() { |
| +} |
| + |
| +ProfileKeyedService* NetworkingPrivateAPIFactory::BuildServiceInstanceFor( |
| + Profile* profile) const { |
| + return new NetworkingPrivateAPI(profile); |
| +} |
| + |
| +bool NetworkingPrivateAPIFactory::ServiceHasOwnInstanceInIncognito() const { |
| + // Explicitly and always allow this service in guest login mode. See |
|
pneubeck (no reviews)
2013/01/18 13:22:36
whitespace
Greg Spencer (Chromium)
2013/01/18 19:53:56
Done.
|
| + // chrome/browser/profiles/profile_keyed_base_factory.h comment |
| + // for the details. |
| + return true; |
| +} |
| + |
| +bool NetworkingPrivateAPIFactory::ServiceIsCreatedWithProfile() const { |
| + return true; |
| +} |
| + |
| +bool NetworkingPrivateAPIFactory::ServiceIsNULLWhileTesting() const { |
| + return true; |
| +} |
| + |
| +} // namespace chromeos |
| + |