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

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

Issue 378103002: Add NetworkingPrivateDelegate class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ServiceClient Created 6 years, 5 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/extensions/api/networking_private/networking_private_factory_chromeos.cc
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_factory_chromeos.cc b/chrome/browser/extensions/api/networking_private/networking_private_factory_chromeos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f6c8f11c965f5200645d7325477a96a22875ea87
--- /dev/null
+++ b/chrome/browser/extensions/api/networking_private/networking_private_factory_chromeos.cc
@@ -0,0 +1,62 @@
+// Copyright 2014 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_factory_chromeos.h"
+
+#include "chrome/browser/extensions/api/networking_private/networking_private_chromeos.h"
+#include "chrome/browser/extensions/api/networking_private/networking_private_delegate.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "content/public/browser/browser_thread.h"
+#include "extensions/browser/extension_system_provider.h"
+#include "extensions/browser/extensions_browser_client.h"
+
+namespace extensions {
+
+// static
+NetworkingPrivateDelegate* NetworkingPrivateDelegate::GetForBrowserContext(
+ content::BrowserContext* browser_context) {
+ return NetworkingPrivateChromeOSFactory::GetForBrowserContext(
+ browser_context);
+}
+
+// static
+NetworkingPrivateChromeOS*
+NetworkingPrivateChromeOSFactory::GetForBrowserContext(
+ content::BrowserContext* browser_context) {
+ return static_cast<NetworkingPrivateChromeOS*>(
+ GetInstance()->GetServiceForBrowserContext(browser_context, true));
+}
+
+// static
+NetworkingPrivateChromeOSFactory*
+NetworkingPrivateChromeOSFactory::GetInstance() {
+ return Singleton<NetworkingPrivateChromeOSFactory>::get();
+}
+
+NetworkingPrivateChromeOSFactory::NetworkingPrivateChromeOSFactory()
+ : BrowserContextKeyedServiceFactory(
+ "NetworkingPrivateChromeOS",
+ BrowserContextDependencyManager::GetInstance()) {
+ DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
+}
+
+NetworkingPrivateChromeOSFactory::~NetworkingPrivateChromeOSFactory() {
+}
+
+KeyedService* NetworkingPrivateChromeOSFactory::BuildServiceInstanceFor(
+ content::BrowserContext* browser_context) const {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ return new NetworkingPrivateChromeOS(browser_context);
+}
+
+bool NetworkingPrivateChromeOSFactory::ServiceIsCreatedWithBrowserContext()
+ const {
+ return false;
+}
+
+bool NetworkingPrivateChromeOSFactory::ServiceIsNULLWhileTesting() const {
+ return false;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698