| 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 #ifndef CHROME_BROWSER_CHROMEOS_VPN_VPN_SERVICE_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_VPN_VPN_SERVICE_H_ | 6 #define EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 15 #include "chromeos/network/network_configuration_observer.h" | 16 #include "chromeos/network/network_configuration_observer.h" |
| 16 #include "chromeos/network/network_state_handler_observer.h" | 17 #include "chromeos/network/network_state_handler_observer.h" |
| 17 #include "components/keyed_service/core/keyed_service.h" | 18 #include "components/keyed_service/core/keyed_service.h" |
| 18 #include "extensions/browser/extension_registry_observer.h" | 19 #include "extensions/browser/extension_registry_observer.h" |
| 19 #include "extensions/common/api/vpn_provider.h" | 20 #include "extensions/common/api/vpn_provider.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Calls |success| or |failure| based on the outcome. | 113 // Calls |success| or |failure| based on the outcome. |
| 113 void SetParameters(const std::string& extension_id, | 114 void SetParameters(const std::string& extension_id, |
| 114 const base::DictionaryValue& parameters, | 115 const base::DictionaryValue& parameters, |
| 115 const SuccessCallback& success, | 116 const SuccessCallback& success, |
| 116 const FailureCallback& failure); | 117 const FailureCallback& failure); |
| 117 | 118 |
| 118 // Sends an IP packet contained in |data| to the active VPN configuration | 119 // Sends an IP packet contained in |data| to the active VPN configuration |
| 119 // after verifying that it belongs to the extension with id |extension_id|. | 120 // after verifying that it belongs to the extension with id |extension_id|. |
| 120 // Calls |success| or |failure| based on the outcome. | 121 // Calls |success| or |failure| based on the outcome. |
| 121 void SendPacket(const std::string& extension_id, | 122 void SendPacket(const std::string& extension_id, |
| 122 const std::string& data, | 123 const std::vector<char>& data, |
| 123 const SuccessCallback& success, | 124 const SuccessCallback& success, |
| 124 const FailureCallback& failure); | 125 const FailureCallback& failure); |
| 125 | 126 |
| 126 // Notifies connection state |state| to the active VPN configuration after | 127 // Notifies connection state |state| to the active VPN configuration after |
| 127 // verifying that it belongs to the extension with id |extension_id|. | 128 // verifying that it belongs to the extension with id |extension_id|. |
| 128 // Calls |success| or |failure| based on the outcome. | 129 // Calls |success| or |failure| based on the outcome. |
| 129 void NotifyConnectionStateChanged( | 130 void NotifyConnectionStateChanged( |
| 130 const std::string& extension_id, | 131 const std::string& extension_id, |
| 131 extensions::core_api::vpn_provider::VpnConnectionState state, | 132 extensions::core_api::vpn_provider::VpnConnectionState state, |
| 132 const SuccessCallback& success, | 133 const SuccessCallback& success, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // Service path does not own the VpnConfigurations. | 208 // Service path does not own the VpnConfigurations. |
| 208 StringToConfigurationMap service_path_to_configuration_map_; | 209 StringToConfigurationMap service_path_to_configuration_map_; |
| 209 | 210 |
| 210 base::WeakPtrFactory<VpnService> weak_factory_; | 211 base::WeakPtrFactory<VpnService> weak_factory_; |
| 211 | 212 |
| 212 DISALLOW_COPY_AND_ASSIGN(VpnService); | 213 DISALLOW_COPY_AND_ASSIGN(VpnService); |
| 213 }; | 214 }; |
| 214 | 215 |
| 215 } // namespace chromeos | 216 } // namespace chromeos |
| 216 | 217 |
| 217 #endif // CHROME_BROWSER_CHROMEOS_VPN_VPN_SERVICE_H_ | 218 #endif // EXTENSIONS_BROWSER_API_VPN_PROVIDER_VPN_SERVICE_H_ |
| OLD | NEW |