| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 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 | 
|  | 3 // found in the LICENSE file. | 
|  | 4 | 
|  | 5 #ifndef CHROMEOS_DBUS_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_ | 
|  | 6 #define CHROMEOS_DBUS_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_ | 
|  | 7 | 
|  | 8 #include <stdint.h> | 
|  | 9 | 
|  | 10 #include "base/callback.h" | 
|  | 11 #include "chromeos/chromeos_export.h" | 
|  | 12 #include "chromeos/dbus/dbus_client.h" | 
|  | 13 #include "chromeos/dbus/shill_client_helper.h" | 
|  | 14 #include "dbus/object_path.h" | 
|  | 15 | 
|  | 16 namespace chromeos { | 
|  | 17 | 
|  | 18 class ShillThirdPartyVpnObserver; | 
|  | 19 | 
|  | 20 // ShillThirdPartyVpnDriverClient is used to communicate with the Shill | 
|  | 21 // ThirdPartyVpnDriver service. | 
|  | 22 // All methods should be called from the origin thread which initializes the | 
|  | 23 // DBusThreadManager instance. | 
|  | 24 class CHROMEOS_EXPORT ShillThirdPartyVpnDriverClient : public DBusClient { | 
|  | 25  public: | 
|  | 26   class TestInterface { | 
|  | 27    public: | 
|  | 28     virtual void OnPacketReceived(const dbus::ObjectPath& object_path, | 
|  | 29                                   const std::string& packet) = 0; | 
|  | 30     virtual void OnPlatformMessage(const dbus::ObjectPath& object_path, | 
|  | 31                                    uint32_t message) = 0; | 
|  | 32 | 
|  | 33    protected: | 
|  | 34     virtual ~TestInterface() {} | 
|  | 35   }; | 
|  | 36 | 
|  | 37   ~ShillThirdPartyVpnDriverClient() override; | 
|  | 38 | 
|  | 39   // Factory function, creates a new instance which is owned by the caller. | 
|  | 40   // For normal usage, access the singleton via DBusThreadManager::Get(). | 
|  | 41   static ShillThirdPartyVpnDriverClient* Create(); | 
|  | 42 | 
|  | 43   // Adds an |observer| for the third party vpn driver at |object_path|. | 
|  | 44   virtual void AddShillThirdPartyVpnObserver( | 
|  | 45       const dbus::ObjectPath& object_path, | 
|  | 46       ShillThirdPartyVpnObserver* observer) = 0; | 
|  | 47 | 
|  | 48   // Removes an |observer| for the third party vpn driver at |object_path|. | 
|  | 49   virtual void RemoveShillThirdPartyVpnObserver( | 
|  | 50       const dbus::ObjectPath& object_path) = 0; | 
|  | 51 | 
|  | 52   // Calls SetParameters method. | 
|  | 53   // |callback| is called after the method call succeeds. | 
|  | 54   virtual void SetParameters( | 
|  | 55       const dbus::ObjectPath& object_path, | 
|  | 56       const base::DictionaryValue& parameters, | 
|  | 57       const base::Closure& callback, | 
|  | 58       const ShillClientHelper::ErrorCallback& error_callback) = 0; | 
|  | 59 | 
|  | 60   // Calls UpdateConnectionState method. | 
|  | 61   // |callback| is called after the method call succeeds. | 
|  | 62   virtual void UpdateConnectionState( | 
|  | 63       const dbus::ObjectPath& object_path, | 
|  | 64       const uint32_t connection_state, | 
|  | 65       const base::Closure& callback, | 
|  | 66       const ShillClientHelper::ErrorCallback& error_callback) = 0; | 
|  | 67 | 
|  | 68   // Calls SendPacket method. | 
|  | 69   // |callback| is called after the method call succeeds. | 
|  | 70   virtual void SendPacket( | 
|  | 71       const dbus::ObjectPath& object_path, | 
|  | 72       const std::string& ip_packet, | 
|  | 73       const base::Closure& callback, | 
|  | 74       const ShillClientHelper::ErrorCallback& error_callback) = 0; | 
|  | 75 | 
|  | 76   // Returns an interface for testing (stub only), or returns NULL. | 
|  | 77   virtual ShillThirdPartyVpnDriverClient::TestInterface* GetTestInterface() = 0; | 
|  | 78 | 
|  | 79  protected: | 
|  | 80   friend class ShillThirdPartyVpnDriverClientTest; | 
|  | 81 | 
|  | 82   // Create() should be used instead. | 
|  | 83   ShillThirdPartyVpnDriverClient(); | 
|  | 84 | 
|  | 85  private: | 
|  | 86   DISALLOW_COPY_AND_ASSIGN(ShillThirdPartyVpnDriverClient); | 
|  | 87 }; | 
|  | 88 | 
|  | 89 }  // namespace chromeos | 
|  | 90 | 
|  | 91 #endif  // CHROMEOS_DBUS_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_ | 
| OLD | NEW | 
|---|