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( |
pneubeck (no reviews)
2014/07/14 21:33:58
to implement this function here is very surprising
stevenjb
2014/07/15 00:33:40
I have seen this pattern used before. I think that
pneubeck (no reviews)
2014/07/15 12:06:07
You likely mean the common pattern:
abc.h:
stat
|
+ 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()); |
pneubeck (no reviews)
2014/07/14 21:33:58
not required?
I don't find any access to the Exten
stevenjb
2014/07/15 00:33:40
I copy/pasted this, but we don't have any direct d
|
+} |
+ |
+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 |