Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4715)

Unified Diff: chrome/browser/chromeos/extensions/networking_private_api_factory.cc

Issue 11975015: This adds a private extension API to use for simple networking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Converting to ONC Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
+

Powered by Google App Engine
This is Rietveld 408576698