| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h" | 5 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "chromeos/dbus/dbus_thread_manager.h" |
| 9 #include "chromeos/network/network_handler.h" |
| 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 9 #include "extensions/browser/api/vpn_provider/vpn_service.h" | 11 #include "extensions/browser/api/vpn_provider/vpn_service.h" |
| 12 #include "extensions/browser/event_router.h" |
| 13 #include "extensions/browser/extension_registry.h" |
| 10 | 14 |
| 11 namespace chromeos { | 15 namespace chromeos { |
| 12 | 16 |
| 13 // This file is a dummy stub for use in appshell. | 17 // This file is a dummy stub for use in appshell. |
| 14 | 18 |
| 15 // static | 19 // static |
| 16 VpnService* VpnServiceFactory::GetForBrowserContext( | 20 VpnService* VpnServiceFactory::GetForBrowserContext( |
| 17 content::BrowserContext* context) { | 21 content::BrowserContext* context) { |
| 18 return static_cast<VpnService*>( | 22 return static_cast<VpnService*>( |
| 19 GetInstance()->GetServiceForBrowserContext(context, true)); | 23 GetInstance()->GetServiceForBrowserContext(context, true)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 36 bool VpnServiceFactory::ServiceIsCreatedWithBrowserContext() const { | 40 bool VpnServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
| 37 return true; | 41 return true; |
| 38 } | 42 } |
| 39 | 43 |
| 40 bool VpnServiceFactory::ServiceIsNULLWhileTesting() const { | 44 bool VpnServiceFactory::ServiceIsNULLWhileTesting() const { |
| 41 return true; | 45 return true; |
| 42 } | 46 } |
| 43 | 47 |
| 44 KeyedService* VpnServiceFactory::BuildServiceInstanceFor( | 48 KeyedService* VpnServiceFactory::BuildServiceInstanceFor( |
| 45 content::BrowserContext* context) const { | 49 content::BrowserContext* context) const { |
| 46 return nullptr; | 50 return new VpnService( |
| 51 context, "testuser", extensions::ExtensionRegistry::Get(context), |
| 52 extensions::EventRouter::Get(context), |
| 53 DBusThreadManager::Get()->GetShillThirdPartyVpnDriverClient(), |
| 54 NetworkHandler::Get()->network_configuration_handler(), |
| 55 NetworkHandler::Get()->network_profile_handler(), |
| 56 NetworkHandler::Get()->network_state_handler()); |
| 47 } | 57 } |
| 48 | 58 |
| 49 } // namespace chromeos | 59 } // namespace chromeos |
| OLD | NEW |