OLD | NEW |
| (Empty) |
1 // Copyright 2013 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 REMOTING_CLIENT_PLUGIN_DELEGATING_SIGNAL_STRATEGY_H_ | |
6 #define REMOTING_CLIENT_PLUGIN_DELEGATING_SIGNAL_STRATEGY_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/macros.h" | |
10 #include "base/observer_list.h" | |
11 #include "remoting/signaling/signal_strategy.h" | |
12 | |
13 namespace base { | |
14 class SingleThreadTaskRunner; | |
15 } // namespace base | |
16 | |
17 namespace remoting { | |
18 | |
19 class DelegatingSignalStrategy : public SignalStrategy { | |
20 public: | |
21 typedef base::Callback<void(const std::string&)> SendIqCallback; | |
22 | |
23 DelegatingSignalStrategy(std::string local_jid, | |
24 const SendIqCallback& send_iq_callback); | |
25 ~DelegatingSignalStrategy() override; | |
26 | |
27 void OnIncomingMessage(const std::string& message); | |
28 | |
29 // SignalStrategy interface. | |
30 void Connect() override; | |
31 void Disconnect() override; | |
32 State GetState() const override; | |
33 Error GetError() const override; | |
34 std::string GetLocalJid() const override; | |
35 void AddListener(Listener* listener) override; | |
36 void RemoveListener(Listener* listener) override; | |
37 bool SendStanza(std::unique_ptr<buzz::XmlElement> stanza) override; | |
38 std::string GetNextId() override; | |
39 | |
40 private: | |
41 std::string local_jid_; | |
42 SendIqCallback send_iq_callback_; | |
43 | |
44 base::ObserverList<Listener> listeners_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(DelegatingSignalStrategy); | |
47 }; | |
48 | |
49 } // namespace remoting | |
50 | |
51 #endif // REMOTING_CLIENT_PLUGIN_DELEGATING_SIGNAL_STRATEGY_H_ | |
OLD | NEW |