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

Unified Diff: chrome/browser/extensions/api/networking_private/networking_private_service_client_factory.cc

Issue 54323003: Base infrastructure for Networking Private API on Windows and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Track ToT. Created 7 years, 1 month 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/extensions/api/networking_private/networking_private_service_client_factory.cc
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_service_client_factory.cc b/chrome/browser/extensions/api/networking_private/networking_private_service_client_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4041e57b6a90e25296236e033f40cb32d8f4a77d
--- /dev/null
+++ b/chrome/browser/extensions/api/networking_private/networking_private_service_client_factory.cc
@@ -0,0 +1,58 @@
+// Copyright 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/extensions/api/networking_private/networking_private_service_client_factory.h"
+
+#include "chrome/browser/extensions/api/networking_private/networking_private_service_client.h"
+#include "chrome/browser/extensions/extension_system_factory.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
+#include "content/public/browser/browser_thread.h"
+
+namespace extensions {
+
+// static
+NetworkingPrivateServiceClient*
+ NetworkingPrivateServiceClientFactory::GetForProfile(Profile* profile) {
+ return static_cast<NetworkingPrivateServiceClient*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+NetworkingPrivateServiceClientFactory*
+ NetworkingPrivateServiceClientFactory::GetInstance() {
+ return Singleton<NetworkingPrivateServiceClientFactory>::get();
+}
+
+NetworkingPrivateServiceClientFactory::NetworkingPrivateServiceClientFactory()
+ : BrowserContextKeyedServiceFactory(
+ "NetworkingPrivateServiceClient",
+ BrowserContextDependencyManager::GetInstance()) {
+ DependsOn(ExtensionSystemFactory::GetInstance());
+}
+
+NetworkingPrivateServiceClientFactory
+ ::~NetworkingPrivateServiceClientFactory() {
+}
+
+BrowserContextKeyedService*
+ NetworkingPrivateServiceClientFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ return new NetworkingPrivateServiceClient(
+ static_cast<Profile*>(profile),
+ wifi::WiFiService::CreateService(),
+ NetworkingPrivateServiceClient::CryptoVerify::Create());
+}
+
+bool NetworkingPrivateServiceClientFactory::ServiceIsCreatedWithBrowserContext()
+ const {
+ return false;
+}
+
+bool NetworkingPrivateServiceClientFactory::ServiceIsNULLWhileTesting() const {
+ return false;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698