1 // Copyright (c) 2011 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.
5 #ifndef JINGLE_GLUE_FAKE_NETWORK_MANAGER_H_
6 #define JINGLE_GLUE_FAKE_NETWORK_MANAGER_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "net/base/net_util.h"
14 #include "third_party/libjingle/source/talk/base/network.h"
16 namespace jingle_glue {
18 // FakeNetworkManager always returns one interface with the IP address
19 // specified in the constructor.
20 class FakeNetworkManager : public talk_base::NetworkManager {
22 FakeNetworkManager(const net::IPAddressNumber& address);
23 virtual ~FakeNetworkManager();
25 // talk_base::NetworkManager interface.
26 virtual void StartUpdating() OVERRIDE;
27 virtual void StopUpdating() OVERRIDE;
28 virtual void GetNetworks(NetworkList* networks) const OVERRIDE;
31 void SendNetworksChangedSignal();
34 scoped_ptr<talk_base::Network> network_;
36 base::WeakPtrFactory<FakeNetworkManager> weak_factory_;
39 } // namespace jingle_glue
41 #endif // JINGLE_GLUE_FAKE_NETWORK_MANAGER_H_